ARM: dts: sun8i-a83t-tbs-a711: HM5065 doesn't like such a high voltage
Subsystems (11)
Sasha Levin
maintainerPATCH 1/35 ARM: dts: sun8i-a83t-tbs-a711: HM5065 doesn't like such a high voltage
From: Ondrej Jirman <[email protected]>
[ Upstream commit a40550952c000667b20082d58077bc647da6c890 ]
Lowering the voltage solves the quick image degradation over time (minutes), that was probably caused by overheating.
--- arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +2 -2
@@ -374,8 +374,8 @@ }; ®_dldo3 { - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; regulator-name = "vdd-csi"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 2/35 bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads
From: Ondrej Jirman <[email protected]>
[ Upstream commit a43ab30dcd4a1abcdd0d2461bf1cf7c0817f6cd3 ]
When doing a 16-bit read that returns data in the MSB byte, the RSB_DATA register will keep the MSB byte unchanged when doing the following 8-bit read. sunxi_rsb_read() will then return a result that contains high byte from 16-bit read mixed with the 8-bit result.
The consequence is that after this happens the PMIC's regmap will look like this: (0x33 is the high byte from the 16-bit read)
% cat /sys/kernel/debug/regmap/sunxi-rsb-3a3/registers 00: 33
01: 33
02: 33
03: 33
04: 33
05: 33
06: 33
07: 33
08: 33
09: 33
0a: 33
0b: 33
0c: 33
0d: 33
0e: 33
[snip]
Fix this by masking the result of the read with the correct mask based on the size of the read. There are no 16-bit users in the mainline kernel, so this doesn't need to get into the stable tree.
--- drivers/bus/sunxi-rsb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/sunxi-rsb.c +1 -1
@@ -345,7 +345,7 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,if (ret) goto unlock; - *buf =readl (rsb->regs +RSB_DATA ); + *buf =readl (rsb->regs +RSB_DATA ) &GENMASK (len *8 -1 ,0 ); unlock:mutex_unlock (&rsb->lock);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/35 ARM: dts: Fix dm814x Ethernet by changing to use rgmii-id mode
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit b46b2b7ba6e104d265ab705914859ec0db7a98c5 ]
Commit cd28d1d6e52e ("net: phy: at803x: Disable phy delay for RGMII mode") caused a regression for dm814x boards where NFSroot would no longer work.
Let's fix the issue by configuring "rgmii-id" mode as internal delays are needed that is no longer the case with "rgmii" mode.
--- arch/arm/boot/dts/dm8148-evm.dts | 4 ++-- arch/arm/boot/dts/dm8148-t410.dts | 4 ++-- arch/arm/boot/dts/dra62x-j5eco-evm.dts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/dm8148-evm.dts +2 -2
@@ -24,12 +24,12 @@ &cpsw_emac0 { phy-handle = <ðphy0>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; }; &cpsw_emac1 { phy-handle = <ðphy1>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; }; &davinci_mdio {
arch/arm/boot/dts/dm8148-t410.dts +2 -2
@@ -33,12 +33,12 @@ &cpsw_emac0 { phy-handle = <ðphy0>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; }; &cpsw_emac1 { phy-handle = <ðphy1>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; }; &davinci_mdio {
arch/arm/boot/dts/dra62x-j5eco-evm.dts +2 -2
@@ -24,12 +24,12 @@ &cpsw_emac0 { phy-handle = <ðphy0>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; }; &cpsw_emac1 { phy-handle = <ðphy1>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; }; &davinci_mdio {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/35 bpf: Fix deadlock with rq_lock in bpf_send_signal()
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit 1bc7896e9ef44fd77858b3ef0b8a6840be3a4494 ]
When experimenting with bpf_send_signal() helper in our production environment (5.2 based), we experienced a deadlock in NMI mode:
#5 [ffffc9002219f770] queued_spin_lock_slowpath at ffffffff8110be24 #6 [ffffc9002219f770] _raw_spin_lock_irqsave at ffffffff81a43012 #7 [ffffc9002219f780] try_to_wake_up at ffffffff810e7ecd
#8 [ffffc9002219f7e0] signal_wake_up_state at ffffffff810c7b55 #9 [ffffc9002219f7f0] __send_signal at ffffffff810c8602
#10 [ffffc9002219f830] do_send_sig_info at ffffffff810ca31a #11 [ffffc9002219f868] bpf_send_signal at ffffffff8119d227 #12 [ffffc9002219f988] bpf_overflow_handler at ffffffff811d4140 #13 [ffffc9002219f9e0] __perf_event_overflow at ffffffff811d68cf #14 [ffffc9002219fa10] perf_swevent_overflow at ffffffff811d6a09 #15 [ffffc9002219fa38] ___perf_sw_event at ffffffff811e0f47 #16 [ffffc9002219fc30] __schedule at ffffffff81a3e04d
#17 [ffffc9002219fc90] schedule at ffffffff81a3e219
#18 [ffffc9002219fca0] futex_wait_queue_me at ffffffff8113d1b9 #19 [ffffc9002219fcd8] futex_wait at ffffffff8113e529
#20 [ffffc9002219fdf0] do_futex at ffffffff8113ffbc
#21 [ffffc9002219fec0] __x64_sys_futex at ffffffff81140d1c #22 [ffffc9002219ff38] do_syscall_64 at ffffffff81002602
#23 [ffffc9002219ff50] entry_SYSCALL_64_after_hwframe at ffffffff81c00068
The above call stack is actually very similar to an issue reported by Commit eac9153f2b58 ("bpf/stackmap: Fix deadlock with rq_lock in bpf_get_stack()") by Song Liu. The only difference is bpf_send_signal() helper instead of bpf_get_stack() helper.
The above deadlock is triggered with a perf_sw_event.
Similar to Commit eac9153f2b58, the below almost identical reproducer used tracepoint point sched/sched_switch so the issue can be easily caught.
/* stress_test.c */
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define THREAD_COUNT 1000
char *filename;
void *worker(void *p)
{
void *ptr;
int fd;
char *pptr; fd = open(filename, O_RDONLY);
if (fd < 0)
return NULL;
while (1) {
struct timespec ts = {0, 1000 + rand() % 2000};
ptr = mmap(NULL, 4096 * 64, PROT_READ, MAP_PRIVATE, fd, 0);
usleep(1);
if (ptr == MAP_FAILED) {
printf("failed to mmap\n");
break;
}
munmap(ptr, 4096 * 64);
usleep(1);
pptr = malloc(1);
usleep(1);
pptr[0] = 1;
usleep(1);
free(pptr);
usleep(1);
nanosleep(&ts, NULL);
}
close(fd);
return NULL;}
int main(int argc, char *argv[])
{
void *ptr;
int i;
pthread_t threads[THREAD_COUNT]; if (argc < 2)
return 0;
filename = argv[1];
for (i = 0; i < THREAD_COUNT; i++) {
if (pthread_create(threads + i, NULL, worker, NULL)) {
fprintf(stderr, "Error creating thread\n");
return 0;
}
}
for (i = 0; i < THREAD_COUNT; i++)
pthread_join(threads[i], NULL);
return 0; }
and the following command:
1. run stress_test /bin/ls in one windown
2. hack bcc trace.py with the following change:
--- a/tools/trace.py
+++ b/tools/trace.py
@@ -513,6 +513,7 @@ BPF_PERF_OUTPUT(%s);
__data.tgid = __tgid;
__data.pid = __pid;
bpf_get_current_comm(&__data.comm, sizeof(__data.comm));
+ bpf_send_signal(10);
%s
%s
%s.perf_submit(%s, &__data, sizeof(__data));
3. in a different window run
./trace.py -p $(pidof stress_test) t:sched:sched_switchThe deadlock can be reproduced in our production system.
Similar to Song's fix, the fix is to delay sending signal if irqs is disabled to avoid deadlocks involving with rq_lock. With this change, my above stress-test in our production system won't cause deadlock any more.
I also implemented a scale-down version of reproducer in the selftest (a subsequent commit). With latest bpf-next, it complains for the following potential deadlock.
[ 32.832450] -> #1 (&p->pi_lock){-.-.}:
[ 32.833100] _raw_spin_lock_irqsave+0x44/0x80
[ 32.833696] task_rq_lock+0x2c/0xa0
[ 32.834182] task_sched_runtime+0x59/0xd0
[ 32.834721] thread_group_cputime+0x250/0x270
[ 32.835304] thread_group_cputime_adjusted+0x2e/0x70
[ 32.835959] do_task_stat+0x8a7/0xb80
[ 32.836461] proc_single_show+0x51/0xb0
...
[ 32.839512] -> #0 (&(&sighand->siglock)->rlock){....}:
[ 32.840275] __lock_acquire+0x1358/0x1a20
[ 32.840826] lock_acquire+0xc7/0x1d0
[ 32.841309] _raw_spin_lock_irqsave+0x44/0x80
[ 32.841916] __lock_task_sighand+0x79/0x160
[ 32.842465] do_send_sig_info+0x35/0x90
[ 32.842977] bpf_send_signal+0xa/0x10
[ 32.843464] bpf_prog_bc13ed9e4d3163e3_send_signal_tp_sched+0x465/0x1000
[ 32.844301] trace_call_bpf+0x115/0x270
[ 32.844809] perf_trace_run_bpf_submit+0x4a/0xc0
[ 32.845411] perf_trace_sched_switch+0x10f/0x180
[ 32.846014] __schedule+0x45d/0x880
[ 32.846483] schedule+0x5f/0xd0
...[ 32.853148] Chain exists of: [ 32.853148] &(&sighand->siglock)->rlock --> &p->pi_lock --> &rq->lock [ 32.853148] [ 32.854451] Possible unsafe locking scenario: [ 32.854451] [ 32.855173] CPU0 CPU1 [ 32.855745] ---- ---- [ 32.856278] lock(&rq->lock); [ 32.856671] lock(&p->pi_lock); [ 32.857332] lock(&rq->lock); [ 32.857999] lock(&(&sighand->siglock)->rlock);
Deadlock happens on CPU0 when it tries to acquire &sighand->siglock but it has been held by CPU1 and CPU1 tries to grab &rq->lock and cannot get it.
This is not exactly the callstack in our production environment, but sympotom is similar and both locks are using spin_lock_irqsave() to acquire the lock, and both involves rq_lock. The fix to delay sending signal when irq is disabled also fixed this issue.
--- kernel/trace/bpf_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/bpf_trace.c +1 -1
@@ -731,7 +731,7 @@ BPF_CALL_1(bpf_send_signal, u32, sig)if (unlikely (!nmi_uaccess_okay ()))return -EPERM ; -if (in_nmi ()) { +if (irqs_disabled ()) {/* Do an early check on signal validity. Otherwise, * the error is lost in deferred irq_work. */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/35 net/mlx5e: kTLS, Fix wrong value in record tracker enum
In reply to Sasha LevinFrom: Tariq Toukan <[email protected]>
[ Upstream commit f28ca65efa87b3fb8da3d69ca7cb1ebc0448de66 ]
Fix to match the HW spec: TRACKING state is 1, SEARCHING is 2. No real issue for now, as these values are not currently used.
--- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h +2 -2
@@ -38,8 +38,8 @@ enum {enum {MLX5E_TLS_PROGRESS_PARAMS_RECORD_TRACKER_STATE_START =0 , -MLX5E_TLS_PROGRESS_PARAMS_RECORD_TRACKER_STATE_SEARCHING =1 , -MLX5E_TLS_PROGRESS_PARAMS_RECORD_TRACKER_STATE_TRACKING =2 , +MLX5E_TLS_PROGRESS_PARAMS_RECORD_TRACKER_STATE_TRACKING =1 , +MLX5E_TLS_PROGRESS_PARAMS_RECORD_TRACKER_STATE_SEARCHING =2 , };struct mlx5e_ktls_offload_context_tx {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/35 iwlwifi: mvm: take the required lock when clearing time event data
In reply to Sasha LevinFrom: Avraham Stern <[email protected]>
[ Upstream commit 089e5016d7eb063712063670e6da7c1a4de1a5c1 ]
When receiving a session protection end notification, the time event data is cleared without holding the required lock. Fix it.
--- drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +4 -0
@@ -785,7 +785,9 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,if (!le32_to_cpu (notif->status)) {iwl_mvm_te_check_disconnect (mvm, vif,"Session protection failure" ); +spin_lock_bh (&mvm->time_event_lock);iwl_mvm_te_clear_data (mvm, te_data); +spin_unlock_bh (&mvm->time_event_lock); }if (le32_to_cpu (notif->start)) {
@@ -801,7 +803,9 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,*/ iwl_mvm_te_check_disconnect (mvm, vif,"No beacon heard and the session protection is over already..." ); +spin_lock_bh (&mvm->time_event_lock);iwl_mvm_te_clear_data (mvm, te_data); +spin_unlock_bh (&mvm->time_event_lock); } goto out_unlock;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/35 iwlwifi: consider HE capability when setting LDPC
In reply to Sasha LevinFrom: Mordechay Goodstein <[email protected]>
[ Upstream commit cb377dfda1755b3bc01436755d866c8e5336a762 ]
The AP may set the LDPC capability only in HE (IEEE80211_HE_PHY_CAP1), but we were checking it only in the HT capabilities.
If we don't use this capability when required, the DSP gets the wrong configuration in HE and doesn't work properly.
--- drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +5 -1
@@ -147,7 +147,11 @@ static u16 rs_fw_get_config_flags(struct iwl_mvm *mvm, (vht_ena && (vht_cap->cap & IEEE80211_VHT_CAP_RXLDPC)))) flags |=IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK ; -/* consider our LDPC support in case of HE */ +/* consider LDPC support in case of HE */ +if (he_cap->has_he && (he_cap->he_cap_elem.phy_cap_info[1 ] & +IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD )) + flags |=IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK ; +if (sband->iftype_data && sband->iftype_data->he_cap.has_he && !(sband->iftype_data->he_cap.he_cap_elem.phy_cap_info[1 ] &IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD ))
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/35 iwlwifi: yoyo: don't add TLV offset when reading FIFOs
In reply to Sasha LevinFrom: Mordechay Goodstein <[email protected]>
[ Upstream commit a5688e600e78f9fc68102bf0fe5c797fc2826abe ]
The TLV offset is only used to read registers, while the offset used for the FIFO addresses are hard coded in the driver and not given by the TLV.
If we try to apply the TLV offset when reading the FIFOs, we'll read from invalid addresses, causing the driver to hang.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +3 -7
@@ -8,7 +8,7 @@* Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2015 - 2017 Intel Deutschland GmbH -* Copyright(c) 2018 - 2019 Intel Corporation +* Copyright(c) 2018 - 2020 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2015 - 2017 Intel Deutschland GmbH -* Copyright(c) 2018 - 2019 Intel Corporation +* Copyright(c) 2018 - 2020 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -1407,11 +1407,7 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt, goto out; } -/* -* region register have absolute value so apply rxf offset after -* reading the registers -*/ - offs += rxf_data.offset; + offs = rxf_data.offset;/* Lock fence */ iwl_write_prph_no_grab (fwrt->trans,RXF_SET_FENCE_MODE + offs,0x1 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 9/35 iwlwifi: dbg: don't abort if sending DBGC_SUSPEND_RESUME fails
In reply to Sasha LevinFrom: Luca Coelho <[email protected]>
[ Upstream commit 699b760bd29edba736590fffef7654cb079c753e ]
If the firmware is in a bad state or not initialized fully, sending the DBGC_SUSPEND_RESUME command fails but we can still collect logs.
Instead of aborting the entire dump process, simply ignore the error. By removing the last callpoint that was checking the return value, we can also convert the function to return void.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 15 +++++---------- drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 6 +++--- 2 files changed, 8 insertions(+), 13 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +5 -10
@@ -2491,10 +2491,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx) goto out; } -if (iwl_fw_dbg_stop_restart_recording (fwrt, ¶ms, true)) { -IWL_ERR (fwrt,"Failed to stop DBGC recording, aborting dump\n" ); - goto out; - } +iwl_fw_dbg_stop_restart_recording (fwrt, ¶ms, true);IWL_DEBUG_FW_INFO (fwrt,"WRT: Data collection start\n" );if (iwl_trans_dbg_ini_valid (fwrt->trans))
@@ -2659,14 +2656,14 @@ static int iwl_fw_dbg_restart_recording(struct iwl_trans *trans,return 0 ; } -int iwl_fw_dbg_stop_restart_recording (struct iwl_fw_runtime *fwrt, -struct iwl_fw_dbg_params *params, -bool stop) +void iwl_fw_dbg_stop_restart_recording (struct iwl_fw_runtime *fwrt, +struct iwl_fw_dbg_params *params, +bool stop) {int ret =0 ;if (test_bit (STATUS_FW_ERROR , &fwrt->trans->status)) -return 0 ; +return ;if (fw_has_capa (&fwrt->fw->ucode_capa,IWL_UCODE_TLV_CAPA_DBG_SUSPEND_RESUME_CMD_SUPP ))
@@ -2683,7 +2680,5 @@ int iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt, iwl_fw_set_dbg_rec_on(fwrt); }#endif - -return ret; }IWL_EXPORT_SYMBOL (iwl_fw_dbg_stop_restart_recording);
drivers/net/wireless/intel/iwlwifi/fw/dbg.h +3 -3
@@ -239,9 +239,9 @@ _iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt,_iwl_fw_dbg_trigger_simple_stop ((fwrt), (wdev), \iwl_fw_dbg_get_trigger ((fwrt)->fw,\ (trig))) -int iwl_fw_dbg_stop_restart_recording (struct iwl_fw_runtime *fwrt, -struct iwl_fw_dbg_params *params, -bool stop); +void iwl_fw_dbg_stop_restart_recording (struct iwl_fw_runtime *fwrt, +struct iwl_fw_dbg_params *params, +bool stop);#ifdef CONFIG_IWLWIFI_DEBUGFS static inline void iwl_fw_set_dbg_rec_on (struct iwl_fw_runtime *fwrt)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/35 iwlwifi: mvm: Fix rate scale NSS configuration
In reply to Sasha LevinFrom: Ilan Peer <[email protected]>
[ Upstream commit ce19801ba75a902ab515dda03b57738c708d0781 ]
The TLC configuration did not take into consideration the station's SMPS configuration, and thus configured rates for 2 NSS even if static SMPS was reported by the station. Fix this.
--- .../net/wireless/intel/iwlwifi/mvm/rs-fw.c | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +21 -8
@@ -6,7 +6,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2017 Intel Deutschland GmbH -* Copyright(c) 2018 - 2019 Intel Corporation +* Copyright(c) 2018 - 2020 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -27,7 +27,7 @@* BSD LICENSE * * Copyright(c) 2017 Intel Deutschland GmbH -* Copyright(c) 2018 - 2019 Intel Corporation +* Copyright(c) 2018 - 2020 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -195,11 +195,13 @@ rs_fw_vht_set_enabled_rates(const struct ieee80211_sta *sta, {u16 supp;int i, highest_mcs; +u8 nss = sta->rx_nss; -for (i =0 ; i < sta->rx_nss; i++) { -if (i ==IWL_TLC_NSS_MAX ) -break ; +/* the station support only a single receive chain */ +if (sta->smps_mode ==IEEE80211_SMPS_STATIC ) + nss =1 ; +for (i =0 ; i < nss && i <IWL_TLC_NSS_MAX ; i++) { highest_mcs =rs_fw_vht_highest_rx_mcs_index (vht_cap, i +1 );if (!highest_mcs)continue ;
@@ -245,8 +247,13 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta,u16 tx_mcs_160 =le16_to_cpu (sband->iftype_data->he_cap.he_mcs_nss_supp.tx_mcs_160);int i; +u8 nss = sta->rx_nss; -for (i =0 ; i < sta->rx_nss && i <IWL_TLC_NSS_MAX ; i++) { +/* the station support only a single receive chain */ +if (sta->smps_mode ==IEEE80211_SMPS_STATIC ) + nss =1 ; + +for (i =0 ; i < nss && i <IWL_TLC_NSS_MAX ; i++) {u16 _mcs_160 = (mcs_160 >> (2 * i)) &0x3 ;u16 _mcs_80 = (mcs_80 >> (2 * i)) &0x3 ;u16 _tx_mcs_160 = (tx_mcs_160 >> (2 * i)) &0x3 ;
@@ -307,8 +314,14 @@ static void rs_fw_set_supp_rates(struct ieee80211_sta *sta, cmd->mode =IWL_TLC_MNG_MODE_HT ; cmd->ht_rates[IWL_TLC_NSS_1 ][IWL_TLC_HT_BW_NONE_160 ] =cpu_to_le16 (ht_cap->mcs.rx_mask[0 ]); - cmd->ht_rates[IWL_TLC_NSS_2 ][IWL_TLC_HT_BW_NONE_160 ] = -cpu_to_le16 (ht_cap->mcs.rx_mask[1 ]); + +/* the station support only a single receive chain */ +if (sta->smps_mode ==IEEE80211_SMPS_STATIC ) + cmd->ht_rates[IWL_TLC_NSS_2 ][IWL_TLC_HT_BW_NONE_160 ] = +0 ; +else + cmd->ht_rates[IWL_TLC_NSS_2 ][IWL_TLC_HT_BW_NONE_160 ] = +cpu_to_le16 (ht_cap->mcs.rx_mask[1 ]); } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/35 Input: tm2-touchkey - add support for Coreriver TC360 variant
In reply to Sasha LevinFrom: Nick Reitemeyer <[email protected]>
[ Upstream commit da3289044833769188c0da945d2cec90af35e87e ]
The Coreriver TouchCore 360 is like the midas board touchkey, but it is using a fixed regulator.
--- drivers/input/keyboard/tm2-touchkey.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/input/keyboard/tm2-touchkey.c +11 -0
@@ -75,6 +75,14 @@ static struct touchkey_variant aries_touchkey_variant = { .cmd_led_off = ARIES_TOUCHKEY_CMD_LED_OFF, }; +static const struct touchkey_variant tc360_touchkey_variant = { + .keycode_reg =0x00 , + .base_reg =0x00 , + .fixed_regulator = true, + .cmd_led_on =TM2_TOUCHKEY_CMD_LED_ON , + .cmd_led_off =TM2_TOUCHKEY_CMD_LED_OFF , +}; +static int tm2_touchkey_led_brightness_set (struct led_classdev *led_dev,enum led_brightness brightness) {
@@ -327,6 +335,9 @@ static const struct of_device_id tm2_touchkey_of_match[] = { }, { .compatible = "cypress,aries-touchkey", .data = &aries_touchkey_variant, + }, { + .compatible = "coreriver,tc360-touchkey", + .data = &tc360_touchkey_variant, }, { }, };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 12/35 soc: fsl: dpio: register dpio irq handlers after dpio create
In reply to Sasha LevinFrom: Grigore Popescu <[email protected]>
[ Upstream commit fe8fe7723a3a824790bda681b40efd767e2251a7 ]
The dpio irqs must be registered when you can actually receive interrupts, ie when the dpios are created. Kernel goes through NULL pointer dereference errors followed by kernel panic [1] because the dpio irqs are enabled before the dpio is created.
[1]
Unable to handle kernel NULL pointer dereference at virtual address 0040 fsl_mc_dpio dpio.14: probed fsl_mc_dpio dpio.13: Adding to iommu group 11 ISV = 0, ISS = 0x00000004 Unable to handle kernel NULL pointer dereference at virtual address 0040
Mem abort info:
ESR = 0x96000004
EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0
EA = 0, S1PTW = 0
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
[0000000000000040] user address but active_mm is swapper
Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 2 PID: 151 Comm: kworker/2:1 Not tainted 5.6.0-rc4-next-20200304 #1 Hardware name: NXP Layerscape LX2160ARDB (DT) Workqueue: events deferred_probe_work_func pstate: 00000085 (nzcv daIf -PAN -UAO) pc : dpaa2_io_irq+0x18/0xe0 lr : dpio_irq_handler+0x1c/0x28
sp : ffff800010013e20
x29: ffff800010013e20 x28: ffff0026d9b4c140
x27: ffffa1d38a142018 x26: ffff0026d2953400
x25: ffffa1d38a142018 x24: ffffa1d38a7ba1d8
x23: ffff800010013f24 x22: 0000000000000000
x21: 0000000000000072 x20: ffff0026d2953400
x19: ffff0026d2a68b80 x18: 0000000000000001
x17: 000000002fb37f3d x16: 0000000035eafadd
x15: ffff0026d9b4c5b8 x14: ffffffffffffffff
x13: ff00000000000000 x12: 0000000000000038
x11: 0101010101010101 x10: 0000000000000040
x9 : ffffa1d388db11e4 x8 : ffffa1d38a7e40f0
x7 : ffff0026da414f38 x6 : 0000000000000000
x5 : ffff0026da414d80 x4 : ffff5e5353d0c000
x3 : ffff800010013f60 x2 : ffffa1d388db11c8
x1 : ffff0026d2a67c00 x0 : 0000000000000000
Call trace: dpaa2_io_irq+0x18/0xe0 dpio_irq_handler+0x1c/0x28 __handle_irq_event_percpu+0x78/0x2c0 handle_irq_event_percpu+0x38/0x90 handle_irq_event+0x4c/0xd0 handle_fasteoi_irq+0xbc/0x168 generic_handle_irq+0x2c/0x40 __handle_domain_irq+0x68/0xc0 gic_handle_irq+0x64/0x150 el1_irq+0xb8/0x180 _raw_spin_unlock_irqrestore+0x14/0x48 irq_set_affinity_hint+0x6c/0xa0 dpaa2_dpio_probe+0x2a4/0x518 fsl_mc_driver_probe+0x28/0x70 really_probe+0xdc/0x320 driver_probe_device+0x5c/0xf0 __device_attach_driver+0x88/0xc0 bus_for_each_drv+0x7c/0xc8 __device_attach+0xe4/0x140 device_initial_probe+0x18/0x20 bus_probe_device+0x98/0xa0 device_add+0x41c/0x758 fsl_mc_device_add+0x184/0x530 dprc_scan_objects+0x280/0x370 dprc_probe+0x124/0x3b0 fsl_mc_driver_probe+0x28/0x70 really_probe+0xdc/0x320 driver_probe_device+0x5c/0xf0 __device_attach_driver+0x88/0xc0 bus_for_each_drv+0x7c/0xc8 __device_attach+0xe4/0x140 device_initial_probe+0x18/0x20 bus_probe_device+0x98/0xa0 deferred_probe_work_func+0x74/0xa8 process_one_work+0x1c8/0x470 worker_thread+0x1f8/0x428 kthread+0x124/0x128 ret_from_fork+0x10/0x18 Code: a9bc7bfd 910003fd a9025bf5 a90363f7 (f9402015) ---[ end trace 38298e1a29e7a570 ]--- Kernel panic - not syncing: Fatal exception in interrupt
SMP: stopping secondary CPUs
Mem abort info:
ESR = 0x96000004
CM = 0, WnR = 0
EC = 0x25: DABT (current EL), IL = 32 bits
[0000000000000040] user address but active_mm is swapper
SET = 0, FnV = 0
EA = 0, S1PTW = 0
Data abort info:
ISV = 0, ISS = 0x00000004
CM = 0, WnR = 0
[0000000000000040] user address but active_mm is swapper
SMP: failed to stop secondary CPUs 0-2
Kernel Offset: 0x21d378600000 from 0xffff800010000000PHYS_OFFSET: 0xffffe92180000000
CPU features: 0x10002,21806008
Memory Limit: none
---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
--- drivers/soc/fsl/dpio/dpio-driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/soc/fsl/dpio/dpio-driver.c +4 -4
@@ -233,10 +233,6 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) goto err_allocate_irqs; } - err =register_dpio_irq_handlers (dpio_dev, desc.cpu); -if (err) - goto err_register_dpio_irq; - priv->io =dpaa2_io_create (&desc, dev);if (!priv->io) {dev_err (dev,"dpaa2_io_create failed\n" );
@@ -244,6 +240,10 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev) goto err_dpaa2_io_create; } + err =register_dpio_irq_handlers (dpio_dev, desc.cpu); +if (err) + goto err_register_dpio_irq; +dev_info (dev,"probed\n" );dev_dbg (dev," receives_notifications = %d\n" , desc.receives_notifications);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/35 rxrpc: Abstract out the calculation of whether there's Tx space
In reply to Sasha LevinFrom: David Howells <[email protected]>
[ Upstream commit 158fe6665389964a1de212818b4a5c52b7f7aff4 ]
Abstract out the calculation of there being sufficient Tx buffer space. This is reproduced several times in the rxrpc sendmsg code.
--- net/rxrpc/sendmsg.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
net/rxrpc/sendmsg.c +18 -9
@@ -17,6 +17,21 @@#include <net/af_rxrpc.h> #include "ar-internal.h" +/* +* Return true if there's sufficient Tx queue space. +*/ +static bool rxrpc_check_tx_space (struct rxrpc_call *call,rxrpc_seq_t *_tx_win) +{ +unsigned int win_size = + min_t(unsigned int, call->tx_winsize, + call->cong_cwnd + call->cong_extra); +rxrpc_seq_t tx_win =READ_ONCE (call->tx_hard_ack); + +if (_tx_win) + *_tx_win = tx_win; +return call->tx_top - tx_win < win_size; +} +/* * Wait for space to appear in the Tx queue or a signal to occur. */
@@ -26,9 +41,7 @@ static int rxrpc_wait_for_tx_window_intr(struct rxrpc_sock *rx, {for (;;) {set_current_state (TASK_INTERRUPTIBLE ); -if (call->tx_top - call->tx_hard_ack < - min_t(unsigned int, call->tx_winsize, - call->cong_cwnd + call->cong_extra)) +if (rxrpc_check_tx_space (call,NULL ))return 0 ;if (call->state >=RXRPC_CALL_COMPLETE )
@@ -68,9 +81,7 @@ static int rxrpc_wait_for_tx_window_nonintr(struct rxrpc_sock *rx,set_current_state (TASK_UNINTERRUPTIBLE ); tx_win =READ_ONCE (call->tx_hard_ack); -if (call->tx_top - tx_win < - min_t(unsigned int, call->tx_winsize, - call->cong_cwnd + call->cong_extra)) +if (rxrpc_check_tx_space (call, &tx_win))return 0 ;if (call->state >=RXRPC_CALL_COMPLETE )
@@ -302,9 +313,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,_debug ("alloc" ); -if (call->tx_top - call->tx_hard_ack >= - min_t(unsigned int, call->tx_winsize, - call->cong_cwnd + call->cong_extra)) { +if (!rxrpc_check_tx_space (call,NULL )) { ret = -EAGAIN ;if (msg->msg_flags &MSG_DONTWAIT ) goto maybe_error;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 14/35 rxrpc: Fix call interruptibility handling
In reply to Sasha LevinFrom: David Howells <[email protected]>
[ Upstream commit e138aa7d3271ac1b0690ae2c9b04d51468dce1d6 ]
Fix the interruptibility of kernel-initiated client calls so that they're either only interruptible when they're waiting for a call slot to come available or they're not interruptible at all. Either way, they're not interruptible during transmission.
This should help prevent StoreData calls from being interrupted when writeback is in progress. It doesn't, however, handle interruption during the receive phase.
Userspace-initiated calls are still interruptable. After the signal has been handled, sendmsg() will return the amount of data copied out of the buffer and userspace can perform another sendmsg() call to continue transmission.
--- fs/afs/rxrpc.c | 3 ++- include/net/af_rxrpc.h | 8 +++++++- net/rxrpc/af_rxrpc.c | 4 ++-- net/rxrpc/ar-internal.h | 4 ++-- net/rxrpc/call_object.c | 3 +-- net/rxrpc/conn_client.c | 13 +++++++++--- net/rxrpc/sendmsg.c | 44 +++++++++++++++++++++++++++++++++-------- 7 files changed, 60 insertions(+), 19 deletions(-)
fs/afs/rxrpc.c +2 -1
@@ -414,7 +414,8 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp) afs_wake_up_async_call : afs_wake_up_call_waiter), call->upgrade, - call->intr, + (call->intr ?RXRPC_PREINTERRUPTIBLE : +RXRPC_UNINTERRUPTIBLE ), call->debug_id);if (IS_ERR (rxcall)) { ret =PTR_ERR (rxcall);
include/net/af_rxrpc.h +7 -1
@@ -16,6 +16,12 @@ struct sock;struct socket ;struct rxrpc_call ; +enum rxrpc_interruptibility { +RXRPC_INTERRUPTIBLE ,/* Call is interruptible */ +RXRPC_PREINTERRUPTIBLE ,/* Call can be cancelled whilst waiting for a slot */ +RXRPC_UNINTERRUPTIBLE ,/* Call should not be interruptible at all */ +}; +/* * Debug ID counter for tracing. */
@@ -41,7 +47,7 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *, gfp_t, rxrpc_notify_rx_t, bool, - bool, + enum rxrpc_interruptibility, unsigned int); int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *, struct msghdr *, size_t,
net/rxrpc/af_rxrpc.c +2 -2
@@ -285,7 +285,7 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,gfp_t gfp, rxrpc_notify_rx_t notify_rx, bool upgrade, - bool intr, + enum rxrpc_interruptibility interruptibility, unsigned int debug_id) { struct rxrpc_conn_parameters cp;
@@ -310,7 +310,7 @@ struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *sock,memset (&p,0 ,sizeof (p)); p.user_call_ID = user_call_ID; p.tx_total_len = tx_total_len; - p.intr = intr; + p.interruptibility = interruptibility;memset (&cp,0 ,sizeof (cp)); cp.local = rx->local;
net/rxrpc/ar-internal.h +2 -2
@@ -489,7 +489,6 @@ enum rxrpc_call_flag {RXRPC_CALL_BEGAN_RX_TIMER ,/* We began the expect_rx_by timer */ RXRPC_CALL_RX_HEARD ,/* The peer responded at least once to this call */ RXRPC_CALL_RX_UNDERRUN ,/* Got data underrun */ -RXRPC_CALL_IS_INTR ,/* The call is interruptible */ RXRPC_CALL_DISCONNECTED, /* The call has been disconnected */ };
@@ -598,6 +597,7 @@ struct rxrpc_call {atomic_t usage;u16 service_id;/* service ID */ u8 security_ix;/* Security type */ +enum rxrpc_interruptibility interruptibility;/* At what point call may be interrupted */ u32 call_id;/* call ID on connection */ u32 cid;/* connection ID plus channel index */ int debug_id;/* debug ID for printks */
@@ -720,7 +720,7 @@ struct rxrpc_call_params {u32 normal;/* Max time since last call packet (msec) */ } timeouts;u8 nr_timeouts;/* Number of timeouts specified */ -bool intr;/* The call is interruptible */ +enum rxrpc_interruptibility interruptibility;/* How is interruptible is the call? */ };struct rxrpc_send_params {
net/rxrpc/call_object.c +1 -2
@@ -237,8 +237,7 @@ struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,return call; } -if (p->intr) -__set_bit (RXRPC_CALL_IS_INTR , &call->flags); + call->interruptibility = p->interruptibility; call->tx_total_len = p->tx_total_len; trace_rxrpc_call(call->debug_id, rxrpc_call_new_client, atomic_read(&call->usage),
net/rxrpc/conn_client.c +10 -3
@@ -655,13 +655,20 @@ static int rxrpc_wait_for_channel(struct rxrpc_call *call, gfp_t gfp)add_wait_queue_exclusive (&call->waitq, &myself);for (;;) { -if (test_bit (RXRPC_CALL_IS_INTR , &call->flags)) +switch (call->interruptibility) { +case RXRPC_INTERRUPTIBLE : +case RXRPC_PREINTERRUPTIBLE :set_current_state (TASK_INTERRUPTIBLE ); -else +break ; +case RXRPC_UNINTERRUPTIBLE : +default :set_current_state (TASK_UNINTERRUPTIBLE ); +break ; + }if (call->call_id)break ; -if (test_bit (RXRPC_CALL_IS_INTR , &call->flags) && +if ((call->interruptibility ==RXRPC_INTERRUPTIBLE || + call->interruptibility ==RXRPC_PREINTERRUPTIBLE ) &&signal_pending (current)) { ret = -ERESTARTSYS ;break ;
net/rxrpc/sendmsg.c +36 -8
74 lines not on this page · raw message
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 15/35 rxrpc: Fix sendmsg(MSG_WAITALL) handling
In reply to Sasha LevinFrom: David Howells <[email protected]>
[ Upstream commit 498b577660f08cef5d9e78e0ed6dcd4c0939e98c ]
Fix the handling of sendmsg() with MSG_WAITALL for userspace to round the timeout for when a signal occurs up to at least two jiffies as a 1 jiffy timeout may end up being effectively 0 if jiffies wraps at the wrong time.
--- net/rxrpc/sendmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/rxrpc/sendmsg.c +2 -2
@@ -71,8 +71,8 @@ static int rxrpc_wait_for_tx_window_waitall(struct rxrpc_sock *rx, rtt =READ_ONCE (call->peer->rtt); rtt2 =nsecs_to_jiffies64 (rtt) *2 ; -if (rtt2 <1 ) - rtt2 =1 ; +if (rtt2 <2 ) + rtt2 =2 ; timeout = rtt2; tx_start =READ_ONCE (call->tx_hard_ack);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 16/35 net: stmmac: platform: Fix misleading interrupt error msg
In reply to Sasha LevinFrom: Markus Fuchs <[email protected]>
[ Upstream commit fc191af1bb0d069dc7e981076e8b80af21f1e61d ]
Not every stmmac based platform makes use of the eth_wake_irq or eth_lpi interrupts. Use the platform_get_irq_byname_optional variant for these interrupts, so no error message is displayed, if they can't be found. Rather print an information to hint something might be wrong to assist debugging on platforms which use these interrupts.
--- .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +10 -4
@@ -663,16 +663,22 @@ int stmmac_get_platform_resources(struct platform_device *pdev,* In case the wake up interrupt is not passed from the platform * so the driver will continue to use the mac irq (ndev->irq) */ - stmmac_res->wol_irq =platform_get_irq_byname (pdev,"eth_wake_irq" ); + stmmac_res->wol_irq = +platform_get_irq_byname_optional (pdev,"eth_wake_irq" );if (stmmac_res->wol_irq <0 ) {if (stmmac_res->wol_irq == -EPROBE_DEFER )return -EPROBE_DEFER ; +dev_info (&pdev->dev,"IRQ eth_wake_irq not found\n" ); stmmac_res->wol_irq = stmmac_res->irq; } - stmmac_res->lpi_irq =platform_get_irq_byname (pdev,"eth_lpi" ); -if (stmmac_res->lpi_irq == -EPROBE_DEFER ) -return -EPROBE_DEFER ; + stmmac_res->lpi_irq = +platform_get_irq_byname_optional (pdev,"eth_lpi" ); +if (stmmac_res->lpi_irq <0 ) { +if (stmmac_res->lpi_irq == -EPROBE_DEFER ) +return -EPROBE_DEFER ; +dev_info (&pdev->dev,"IRQ eth_lpi not found\n" ); + } res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); stmmac_res->addr =devm_ioremap_resource (&pdev->dev, res);
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 17/35 net: vxge: fix wrong __VA_ARGS__ usage
In reply to Sasha LevinFrom: Zheng Wei <[email protected]>
[ Upstream commit b317538c47943f9903860d83cc0060409e12d2ff ]
printk in macro vxge_debug_ll uses __VA_ARGS__ without "##" prefix, it causes a build error when there is no variable arguments(e.g. only fmt is specified.).
--- drivers/net/ethernet/neterion/vxge/vxge-config.h | 2 +- drivers/net/ethernet/neterion/vxge/vxge-main.h | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/neterion/vxge/vxge-config.h +1 -1
@@ -2045,7 +2045,7 @@ vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);if ((level >=VXGE_ERR &&VXGE_COMPONENT_LL &VXGE_DEBUG_ERR_MASK ) || \ (level >=VXGE_TRACE &&VXGE_COMPONENT_LL &VXGE_DEBUG_TRACE_MASK ))\if ((mask &VXGE_DEBUG_MASK ) == mask) \ -printk (fmt"\n" , __VA_ARGS__); \ + printk(fmt "\n", ##__VA_ARGS__); \ } while (0) #else#define vxge_debug_ll (level, mask, fmt, ...)
drivers/net/ethernet/neterion/vxge/vxge-main.h +7 -7
@@ -452,49 +452,49 @@ int vxge_fw_upgrade(struct vxgedev *vdev, char *fw_name, int override);#if (VXGE_DEBUG_LL_CONFIG &VXGE_DEBUG_MASK )#define vxge_debug_ll_config (level, fmt, ...) \ - vxge_debug_ll(level, VXGE_DEBUG_LL_CONFIG, fmt, __VA_ARGS__) + vxge_debug_ll(level, VXGE_DEBUG_LL_CONFIG, fmt, ##__VA_ARGS__)#else #define vxge_debug_ll_config (level, fmt, ...)#endif #if (VXGE_DEBUG_INIT &VXGE_DEBUG_MASK )#define vxge_debug_init (level, fmt, ...) \ - vxge_debug_ll(level, VXGE_DEBUG_INIT, fmt, __VA_ARGS__) + vxge_debug_ll(level, VXGE_DEBUG_INIT, fmt, ##__VA_ARGS__)#else #define vxge_debug_init (level, fmt, ...)#endif #if (VXGE_DEBUG_TX &VXGE_DEBUG_MASK )#define vxge_debug_tx (level, fmt, ...) \ - vxge_debug_ll(level, VXGE_DEBUG_TX, fmt, __VA_ARGS__) + vxge_debug_ll(level, VXGE_DEBUG_TX, fmt, ##__VA_ARGS__)#else #define vxge_debug_tx (level, fmt, ...)#endif #if (VXGE_DEBUG_RX &VXGE_DEBUG_MASK )#define vxge_debug_rx (level, fmt, ...) \ - vxge_debug_ll(level, VXGE_DEBUG_RX, fmt, __VA_ARGS__) + vxge_debug_ll(level, VXGE_DEBUG_RX, fmt, ##__VA_ARGS__)#else #define vxge_debug_rx (level, fmt, ...)#endif #if (VXGE_DEBUG_MEM &VXGE_DEBUG_MASK )#define vxge_debug_mem (level, fmt, ...) \ - vxge_debug_ll(level, VXGE_DEBUG_MEM, fmt, __VA_ARGS__) + vxge_debug_ll(level, VXGE_DEBUG_MEM, fmt, ##__VA_ARGS__)#else #define vxge_debug_mem (level, fmt, ...)#endif #if (VXGE_DEBUG_ENTRYEXIT &VXGE_DEBUG_MASK )#define vxge_debug_entryexit (level, fmt, ...) \ - vxge_debug_ll(level, VXGE_DEBUG_ENTRYEXIT, fmt, __VA_ARGS__) + vxge_debug_ll(level, VXGE_DEBUG_ENTRYEXIT, fmt, ##__VA_ARGS__)#else #define vxge_debug_entryexit (level, fmt, ...)#endif #if (VXGE_DEBUG_INTR &VXGE_DEBUG_MASK )#define vxge_debug_intr (level, fmt, ...) \ - vxge_debug_ll(level, VXGE_DEBUG_INTR, fmt, __VA_ARGS__) + vxge_debug_ll(level, VXGE_DEBUG_INTR, fmt, ##__VA_ARGS__)#else #define vxge_debug_intr (level, fmt, ...)#endif
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 18/35 ARM: dts: omap4-droid4: Fix lost touchscreen interrupts
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 4abd9930d189dedaa59097144c6d8f623342fa72 ]
Looks like we can have the maxtouch touchscreen stop producing interrupts if an edge interrupt is lost. This can happen easily when the SoC idles as the gpio controller may not see any state for an edge interrupt if it is briefly triggered when the system is idle.
Also it looks like maxtouch stops sending any further interrupts if the interrupt is not handled. And we do have several cases of maxtouch already configured with a level interrupt, so let's do that.
With level interrupt the gpio controller has the interrupt state visible after idle. Note that eventually we will probably also be using the Linux generic wakeirq configured for the controller, but that cannot be done until the maxtouch driver supports runtime PM.
--- arch/arm/boot/dts/motorola-mapphone-common.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/motorola-mapphone-common.dtsi +1 -1
@@ -413,7 +413,7 @@ reset-gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>; /* gpio173 */ /* gpio_183 with sys_nirq2 pad as wakeup */ - interrupts-extended = <&gpio6 23 IRQ_TYPE_EDGE_FALLING>, + interrupts-extended = <&gpio6 23 IRQ_TYPE_LEVEL_LOW>, <&omap4_pmx_core 0x160>; interrupt-names = "irq", "wakeup"; wakeup-source;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 19/35 riscv: uaccess should be used in nommu mode
In reply to Sasha LevinFrom: Greentime Hu <[email protected]>
[ Upstream commit adccfb1a805ea84d2db38eb53032533279bdaa97 ]
It might have the unaligned access exception when trying to exchange data with user space program. In this case, it failed in tty_ioctl(). Therefore we should enable uaccess.S for NOMMU mode since the generic code doesn't handle the unaligned access cases.
0x8013a212 <tty_ioctl+462>: ld a5,460(s1)
[ 0.115279] Oops - load address misaligned [#1] [ 0.115284] CPU: 0 PID: 29 Comm: sh Not tainted 5.4.0-rc5-00020-gb4c27160d562-dirty #36 [ 0.115294] epc: 000000008013a212 ra : 000000008013a212 sp : 000000008f48dd50 [ 0.115303] gp : 00000000801cac28 tp : 000000008fb80000 t0 : 00000000000000e8 [ 0.115312] t1 : 000000008f58f108 t2 : 0000000000000009 s0 : 000000008f48ddf0 [ 0.115321] s1 : 000000008f8c6220 a0 : 0000000000000001 a1 : 000000008f48dd28 [ 0.115330] a2 : 000000008fb80000 a3 : 00000000801a7398 a4 : 0000000000000000 [ 0.115339] a5 : 0000000000000000 a6 : 000000008f58f0c6 a7 : 000000000000001d [ 0.115348] s2 : 000000008f8c6308 s3 : 000000008f78b7c8 s4 : 000000008fb834c0 [ 0.115357] s5 : 0000000000005413 s6 : 0000000000000000 s7 : 000000008f58f2b0 [ 0.115366] s8 : 000000008f858008 s9 : 000000008f776818 s10: 000000008f776830 [ 0.115375] s11: 000000008fb840a8 t3 : 1999999999999999 t4 : 000000008f78704c [ 0.115384] t5 : 0000000000000005 t6 : 0000000000000002 [ 0.115391] status: 0000000200001880 badaddr: 000000008f8c63ec cause: 0000000000000004 [ 0.115401] ---[ end trace 00d490c6a8b6c9ac ]---
This failure could be fixed after this patch applied.
[ 0.002282] Run /init as init process
Initializing random number generator... [ 0.005573] random: dd: uninitialized urandom read (512 bytes read)
done.
Welcome to Buildroot
buildroot login: root
Password:
Jan 1 00:00:00 login[62]: root login on 'ttySIF0'
~ #
--- arch/riscv/Kconfig | 1 - arch/riscv/include/asm/uaccess.h | 36 ++++++++++++++++---------------- arch/riscv/lib/Makefile | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-)
arch/riscv/Kconfig +0 -1
@@ -52,7 +52,6 @@ config RISCV select PCI_DOMAINS_GENERIC if PCI select PCI_MSI if PCI select RISCV_TIMER - select UACCESS_MEMCPY if !MMU select GENERIC_IRQ_MULTI_HANDLER select GENERIC_ARCH_TOPOLOGY if SMP select ARCH_HAS_PTE_SPECIAL
arch/riscv/include/asm/uaccess.h +18 -18
@@ -11,6 +11,24 @@/* * User space memory access functions */ + +extern unsigned long __must_check __asm_copy_to_user (void __user *to, +const void *from,unsigned long n); +extern unsigned long __must_check __asm_copy_from_user (void *to, +const void __user *from,unsigned long n); + +static inline unsigned long +raw_copy_from_user (void *to,const void __user *from,unsigned long n) +{ +return __asm_copy_from_user (to, from, n); +} + +static inline unsigned long +raw_copy_to_user (void __user *to,const void *from,unsigned long n) +{ +return __asm_copy_to_user (to, from, n); +} +#ifdef CONFIG_MMU #include <linux/errno.h> #include <linux/compiler.h>
@@ -367,24 +385,6 @@ do { \ -EFAULT ; \ }) - -extern unsigned long __must_check __asm_copy_to_user (void __user *to, -const void *from,unsigned long n); -extern unsigned long __must_check __asm_copy_from_user (void *to, -const void __user *from,unsigned long n); - -static inline unsigned long -raw_copy_from_user (void *to,const void __user *from,unsigned long n) -{ -return __asm_copy_from_user (to, from, n); -} - -static inline unsigned long -raw_copy_to_user (void __user *to,const void *from,unsigned long n) -{ -return __asm_copy_to_user (to, from, n); -} -extern long strncpy_from_user (char *dest,const char __user *src,long count);extern long __must_check strlen_user (const char __user *str);
arch/riscv/lib/Makefile +1 -1
@@ -2,5 +2,5 @@ lib-y += delay.o lib-y += memcpy.o lib-y += memset.o -lib-$(CONFIG_MMU) += uaccess.o +lib-y += uaccess.o lib-$(CONFIG_64BIT) += tishift.o
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 20/35 hinic: fix a bug of waitting for IO stopped
In reply to Sasha LevinFrom: Luo bin <[email protected]>
[ Upstream commit 96758117dc528e6d84bd23d205e8cf7f31eda029 ]
it's unreliable for fw to check whether IO is stopped, so driver wait for enough time to ensure IO process is done in hw before freeing resources
--- .../net/ethernet/huawei/hinic/hinic_hw_dev.c | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-)
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c +2 -49
@@ -360,50 +360,6 @@ static int wait_for_db_state(struct hinic_hwdev *hwdev)return -EFAULT ; } -static int wait_for_io_stopped (struct hinic_hwdev *hwdev) -{ -struct hinic_cmd_io_status cmd_io_status; -struct hinic_hwif *hwif = hwdev->hwif; -struct pci_dev *pdev = hwif->pdev; -struct hinic_pfhwdev *pfhwdev; -unsigned long end; -u16 out_size; -int err; - -if (!HINIC_IS_PF (hwif) && !HINIC_IS_PPF (hwif)) { -dev_err (&pdev->dev,"Unsupported PCI Function type\n" ); -return -EINVAL ; - } - - pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); - - cmd_io_status.func_idx =HINIC_HWIF_FUNC_IDX (hwif); - - end = jiffies +msecs_to_jiffies (IO_STATUS_TIMEOUT ); -do { - err =hinic_msg_to_mgmt (&pfhwdev->pf_to_mgmt,HINIC_MOD_COMM , -HINIC_COMM_CMD_IO_STATUS_GET , - &cmd_io_status,sizeof (cmd_io_status), - &cmd_io_status, &out_size, -HINIC_MGMT_MSG_SYNC ); -if ((err) || (out_size !=sizeof (cmd_io_status))) { -dev_err (&pdev->dev,"Failed to get IO status, ret = %d\n" , - err); -return err; - } - -if (cmd_io_status.status ==IO_STOPPED ) { -dev_info (&pdev->dev,"IO stopped\n" ); -return 0 ; - } - -msleep (20 ); - }while (time_before (jiffies, end)); - -dev_err (&pdev->dev,"Wait for IO stopped - Timeout\n" ); -return -ETIMEDOUT ; -} -/** * clear_io_resource - set the IO resources as not active in the NIC * @hwdev: the NIC HW device
@@ -423,11 +379,8 @@ static int clear_io_resources(struct hinic_hwdev *hwdev)return -EINVAL ; } - err =wait_for_io_stopped (hwdev); -if (err) { -dev_err (&pdev->dev,"IO has not stopped yet\n" ); -return err; - } +/* sleep 100ms to wait for firmware stopping I/O */ +msleep (100 ); cmd_clear_io_res.func_idx =HINIC_HWIF_FUNC_IDX (hwif);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 21/35 hinic: fix the bug of clearing event queue
In reply to Sasha LevinFrom: Luo bin <[email protected]>
[ Upstream commit 614eaa943e9fc3fcdbd4aa0692ae84973d363333 ]
should disable eq irq before freeing it, must clear event queue depth in hw before freeing relevant memory to avoid illegal memory access and update consumer idx to avoid invalid interrupt
--- .../net/ethernet/huawei/hinic/hinic_hw_eqs.c | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c +17 -7
@@ -188,7 +188,7 @@ static u8 eq_cons_idx_checksum_set(u32 val)* eq_update_ci - update the HW cons idx of event queue * @eq: the event queue to update the cons idx for **/ -static void eq_update_ci (struct hinic_eq *eq) +static void eq_update_ci (struct hinic_eq *eq,u32 arm_state) {u32 val, addr =EQ_CONS_IDX_REG_ADDR (eq);
@@ -202,7 +202,7 @@ static void eq_update_ci(struct hinic_eq *eq) val |=HINIC_EQ_CI_SET (eq->cons_idx,IDX ) |HINIC_EQ_CI_SET (eq->wrapped,WRAPPED ) | -HINIC_EQ_CI_SET (EQ_ARMED ,INT_ARMED ); +HINIC_EQ_CI_SET (arm_state,INT_ARMED ); val |=HINIC_EQ_CI_SET (eq_cons_idx_checksum_set (val),XOR_CHKSUM );
@@ -347,7 +347,7 @@ static void eq_irq_handler(void *data)else if (eq->type ==HINIC_CEQ )ceq_irq_handler (eq); -eq_update_ci (eq); +eq_update_ci (eq,EQ_ARMED ); }/**
@@ -702,7 +702,7 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwif *hwif, }set_eq_ctrls (eq); -eq_update_ci (eq); +eq_update_ci (eq,EQ_ARMED ); err =alloc_eq_pages (eq);if (err) {
@@ -752,18 +752,28 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwif *hwif,**/ static void remove_eq (struct hinic_eq *eq) { -struct msix_entry *entry = &eq->msix_entry; - -free_irq (entry->vector, eq); +hinic_set_msix_state (eq->hwif, eq->msix_entry.entry, +HINIC_MSIX_DISABLE ); +free_irq (eq->msix_entry.vector, eq);if (eq->type ==HINIC_AEQ ) {struct hinic_eq_work *aeq_work = &eq->aeq_work;cancel_work_sync (&aeq_work->work); +/* clear aeq_len to avoid hw access host memory */ +hinic_hwif_write_reg (eq->hwif, +HINIC_CSR_AEQ_CTRL_1_ADDR (eq->q_id),0 ); }else if (eq->type ==HINIC_CEQ ) {tasklet_kill (&eq->ceq_tasklet); +/* clear ceq_len to avoid hw access host memory */ +hinic_hwif_write_reg (eq->hwif, +HINIC_CSR_CEQ_CTRL_1_ADDR (eq->q_id),0 ); } +/* update cons_idx to avoid invalid interrupt */ + eq->cons_idx =hinic_hwif_read_reg (eq->hwif,EQ_PROD_IDX_REG_ADDR (eq)); +eq_update_ci (eq,EQ_NOT_ARMED ); +free_eq_pages (eq); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 22/35 hinic: fix out-of-order excution in arm cpu
In reply to Sasha LevinFrom: Luo bin <[email protected]>
[ Upstream commit 33f15da216a1f4566b4ec880942556ace30615df ]
add read barrier in driver code to keep from reading other fileds in dma memory which is writable for hw until we have verified the memory is valid for driver
--- drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c | 2 ++ drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c | 2 ++ drivers/net/ethernet/huawei/hinic/hinic_rx.c | 3 +++ drivers/net/ethernet/huawei/hinic/hinic_tx.c | 2 ++ 4 files changed, 9 insertions(+)
drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c +2 -0
@@ -623,6 +623,8 @@ static int cmdq_cmd_ceq_handler(struct hinic_cmdq *cmdq, u16 ci,if (!CMDQ_WQE_COMPLETED (be32_to_cpu (ctrl->ctrl_info)))return -EBUSY ; +dma_rmb (); + errcode =CMDQ_WQE_ERRCODE_GET (be32_to_cpu (status->status_info),VAL );cmdq_sync_cmd_handler (cmdq, ci, errcode);
drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c +2 -0
@@ -235,6 +235,8 @@ static void aeq_irq_handler(struct hinic_eq *eq)if (HINIC_EQ_ELEM_DESC_GET (aeqe_desc,WRAPPED ) == eq->wrapped)break ; +dma_rmb (); + event =HINIC_EQ_ELEM_DESC_GET (aeqe_desc,TYPE );if (event >=HINIC_MAX_AEQ_EVENTS ) {dev_err (&pdev->dev,"Unknown AEQ Event %d\n" , event);
drivers/net/ethernet/huawei/hinic/hinic_rx.c +3 -0
@@ -350,6 +350,9 @@ static int rxq_recv(struct hinic_rxq *rxq, int budget)if (!rq_wqe)break ; +/* make sure we read rx_done before packet length */ +dma_rmb (); + cqe = rq->cqe[ci]; status =be32_to_cpu (cqe->status);hinic_rq_get_sge (rxq->rq, rq_wqe, ci, &sge);
drivers/net/ethernet/huawei/hinic/hinic_tx.c +2 -0
@@ -622,6 +622,8 @@ static int free_tx_poll(struct napi_struct *napi, int budget) do { hw_ci = HW_CONS_IDX(sq) & wq->mask; + dma_rmb(); + /* Reading a WQEBB to get real WQE size and consumer index. */ sq_wqe = hinic_sq_read_wqebb(sq, &skb, &wqe_size, &sw_ci); if ((!sq_wqe) ||
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 23/35 hinic: fix wrong para of wait_for_completion_timeout
In reply to Sasha LevinFrom: Luo bin <[email protected]>
[ Upstream commit 0da7c322f116210ebfdda59c7da663a6fc5e9cc8 ]
the second input parameter of wait_for_completion_timeout should be jiffies instead of millisecond
--- drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c | 3 ++- drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c +2 -1
@@ -389,7 +389,8 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq,spin_unlock_bh (&cmdq->cmdq_lock); -if (!wait_for_completion_timeout (&done,CMDQ_TIMEOUT )) { +if (!wait_for_completion_timeout (&done, +msecs_to_jiffies (CMDQ_TIMEOUT ))) {spin_lock_bh (&cmdq->cmdq_lock);if (cmdq->errcode[curr_prod_idx] == &errcode)
drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +3 -2
@@ -43,7 +43,7 @@#define MSG_NOT_RESP 0xFFFF -#define MGMT_MSG_TIMEOUT 1000 +#define MGMT_MSG_TIMEOUT 5000#define mgmt_to_pfhwdev (pf_mgmt) \ container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)
@@ -267,7 +267,8 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt, goto unlock_sync_msg; } -if (!wait_for_completion_timeout (recv_done,MGMT_MSG_TIMEOUT )) { +if (!wait_for_completion_timeout (recv_done, +msecs_to_jiffies (MGMT_MSG_TIMEOUT ))) {dev_err (&pdev->dev,"MGMT timeout, MSG id = %d\n" , msg_id); err = -ETIMEDOUT ; goto unlock_sync_msg;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 24/35 hinic: fix wrong value of MIN_SKB_LEN
In reply to Sasha LevinFrom: Luo bin <[email protected]>
[ Upstream commit 7296695fc16dd1761dbba8b68a9181c71cef0633 ]
the minimum value of skb len that hw supports is 32 rather than 17
--- drivers/net/ethernet/huawei/hinic/hinic_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/huawei/hinic/hinic_tx.c +1 -1
@@ -45,7 +45,7 @@#define HW_CONS_IDX (sq) be16_to_cpu(*(u16 *)((sq)->hw_ci_addr)) -#define MIN_SKB_LEN 17 +#define MIN_SKB_LEN 32#define MAX_PAYLOAD_OFFSET 221#define TRANSPORT_OFFSET (l4_hdr, skb) ((u32)((l4_hdr) - (skb)->data))
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 25/35 selftests/net: add definition for SOL_DCCP to fix compilation errors for old libc
In reply to Sasha LevinFrom: Alan Maguire <[email protected]>
[ Upstream commit 83a9b6f639e9f6b632337f9776de17d51d969c77 ]
Many systems build/test up-to-date kernels with older libcs, and an older glibc (2.17) lacks the definition of SOL_DCCP in /usr/include/bits/socket.h (it was added in the 4.6 timeframe).
Adding the definition to the test program avoids a compilation failure that gets in the way of building tools/testing/selftests/net. The test itself will work once the definition is added; either skipping due to DCCP not being configured in the kernel under test or passing, so there are no other more up-to-date glibc dependencies here it seems beyond that missing definition.
--- tools/testing/selftests/net/reuseport_addr_any.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/testing/selftests/net/reuseport_addr_any.c +4 -0
@@ -21,6 +21,10 @@#include <sys/socket.h> #include <unistd.h> +#ifndef SOL_DCCP +#define SOL_DCCP 269 +#endif +static const char *IP4_ADDR ="127.0.0.1" ;static const char *IP6_ADDR ="::1" ;static const char *IP4_MAPPED6 ="::ffff:127.0.0.1" ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 26/35 IB/hfi1: Ensure pq is not left on waitlist
In reply to Sasha LevinFrom: Mike Marciniszyn <[email protected]>
[ Upstream commit 9a293d1e21a6461a11b4217b155bf445e57f4131 ]
The following warning can occur when a pq is left on the dmawait list and the pq is then freed:
WARNING: CPU: 47 PID: 3546 at lib/list_debug.c:29 __list_add+0x65/0xc0 list_add corruption. next->prev should be prev (ffff939228da1880), but was ffff939cabb52230. (next=ffff939cabb52230). Modules linked in: mmfs26(OE) mmfslinux(OE) tracedev(OE) 8021q garp mrp ib_isert iscsi_target_mod target_core_mod crc_t10dif crct10dif_generic opa_vnic rpcrdma ib_iser libiscsi scsi_transport_iscsi ib_ipoib(OE) bridge stp llc iTCO_wdt iTCO_vendor_support intel_powerclamp coretemp intel_rapl iosf_mbi kvm_intel kvm irqbypass crct10dif_pclmul crct10dif_common crc32_pclmul ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper cryptd ast ttm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm pcspkr joydev drm_panel_orientation_quirks i2c_i801 mei_me lpc_ich mei wmi ipmi_si ipmi_devintf ipmi_msghandler nfit libnvdimm acpi_power_meter acpi_pad hfi1(OE) rdmavt(OE) rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm ib_core binfmt_misc numatools(OE) xpmem(OE) ip_tables nfsv3 nfs_acl nfs lockd grace sunrpc fscache igb ahci libahci i2c_algo_bit dca libata ptp pps_core crc32c_intel [last unloaded: i2c_algo_bit] CPU: 47 PID: 3546 Comm: wrf.exe Kdump: loaded Tainted: G W OE ------------ 3.10.0-957.41.1.el7.x86_64 #1 Hardware name: HPE.COM HPE SGI 8600-XA730i Gen10/X11DPT-SB-SG007, BIOS SBED1229 01/22/2019 Call Trace: [<ffffffff91f65ac0>] dump_stack+0x19/0x1b [<ffffffff91898b78>] __warn+0xd8/0x100 [<ffffffff91898bff>] warn_slowpath_fmt+0x5f/0x80 [<ffffffff91a1dabe>] ? ___slab_alloc+0x24e/0x4f0 [<ffffffff91b97025>] __list_add+0x65/0xc0 [<ffffffffc03926a5>] defer_packet_queue+0x145/0x1a0 [hfi1] [<ffffffffc0372987>] sdma_check_progress+0x67/0xa0 [hfi1] [<ffffffffc03779d2>] sdma_send_txlist+0x432/0x550 [hfi1] [<ffffffff91a20009>] ? kmem_cache_alloc+0x179/0x1f0 [<ffffffffc0392973>] ? user_sdma_send_pkts+0xc3/0x1990 [hfi1] [<ffffffffc0393e3a>] user_sdma_send_pkts+0x158a/0x1990 [hfi1] [<ffffffff918ab65e>] ? try_to_del_timer_sync+0x5e/0x90 [<ffffffff91a3fe1a>] ? __check_object_size+0x1ca/0x250 [<ffffffffc0395546>] hfi1_user_sdma_process_request+0xd66/0x1280 [hfi1] [<ffffffffc034e0da>] hfi1_aio_write+0xca/0x120 [hfi1] [<ffffffff91a4245b>] do_sync_readv_writev+0x7b/0xd0 [<ffffffff91a4409e>] do_readv_writev+0xce/0x260 [<ffffffff918df69f>] ? pick_next_task_fair+0x5f/0x1b0 [<ffffffff918db535>] ? sched_clock_cpu+0x85/0xc0 [<ffffffff91f6b16a>] ? __schedule+0x13a/0x860 [<ffffffff91a442c5>] vfs_writev+0x35/0x60 [<ffffffff91a4447f>] SyS_writev+0x7f/0x110 [<ffffffff91f78ddb>] system_call_fastpath+0x22/0x27
The issue happens when wait_event_interruptible_timeout() returns a value <= 0.
In that case, the pq is left on the list. The code continues sending packets and potentially can complete the current request with the pq still on the dmawait list provided no descriptor shortage is seen.
If the pq is torn down in that state, the sdma interrupt handler could find the now freed pq on the list with list corruption or memory corruption resulting.
Fix by adding a flush routine to ensure that the pq is never on a list after processing a request.
A follow-up patch series will address issues with seqlock surfaced in:
https://lore.kernel.org/r/[email protected]
The seqlock use for sdma will then be converted to a spin lock since the list_empty() doesn't need the protection afforded by the sequence lock currently in use.
--- drivers/infiniband/hw/hfi1/user_sdma.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hfi1/user_sdma.c +22 -3
@@ -141,6 +141,7 @@ static int defer_packet_queue(*/ xchg (&pq->state,SDMA_PKT_Q_DEFERRED );if (list_empty (&pq->busy.list)) { + pq->busy.lock = &sde->waitlock;iowait_get_priority (&pq->busy);iowait_queue (pkts_sent, &pq->busy, &sde->dmawait); }
@@ -155,6 +156,7 @@ static void activate_packet_queue(struct iowait *wait, int reason) {struct hfi1_user_sdma_pkt_q *pq = container_of(wait, struct hfi1_user_sdma_pkt_q, busy); + pq->busy.lock =NULL ;xchg (&pq->state,SDMA_PKT_Q_ACTIVE );wake_up (&wait->wait_dma); };
@@ -256,6 +258,21 @@ int hfi1_user_sdma_alloc_queues(struct hfi1_ctxtdata *uctxt,return ret; } +static void flush_pq_iowait (struct hfi1_user_sdma_pkt_q *pq) +{ +unsigned long flags; +seqlock_t *lock = pq->busy.lock; + +if (!lock) +return ; +write_seqlock_irqsave (lock, flags); +if (!list_empty (&pq->busy.list)) { +list_del_init (&pq->busy.list); + pq->busy.lock =NULL ; + } +write_sequnlock_irqrestore (lock, flags); +} +int hfi1_user_sdma_free_queues (struct hfi1_filedata *fd,struct hfi1_ctxtdata *uctxt) {
@@ -281,6 +298,7 @@ int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd,kfree (pq->reqs);kfree (pq->req_in_use);kmem_cache_destroy (pq->txreq_cache); +flush_pq_iowait (pq);kfree (pq); }else {spin_unlock (&fd->pq_rcu_lock);
@@ -587,11 +605,12 @@ int hfi1_user_sdma_process_request(struct hfi1_filedata *fd,if (ret <0 ) {if (ret != -EBUSY ) goto free_req; -wait_event_interruptible_timeout ( +if (wait_event_interruptible_timeout ( pq->busy.wait_dma, - (pq->state ==SDMA_PKT_Q_ACTIVE ), + pq->state ==SDMA_PKT_Q_ACTIVE ,msecs_to_jiffies ( -SDMA_IOWAIT_TIMEOUT )); +SDMA_IOWAIT_TIMEOUT )) <=0 ) +flush_pq_iowait (pq); } } *count += idx;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 27/35 netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
In reply to Sasha LevinFrom: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 8c2d45b2b65ca1f215244be1c600236e83f9815f ]
Currently, the -EEXIST return code of ->insert() callbacks is ambiguous: it might indicate that a given element (including intervals) already exists as such, or that the new element would clash with existing ones.
If identical elements already exist, the front-end is ignoring this without returning error, in case NLM_F_EXCL is not set. However, if the new element can't be inserted due an overlap, we should report this to the user.
To this purpose, allow set back-ends to return -ENOTEMPTY on collision with existing elements, translate that to -EEXIST, and return that to userspace, no matter if NLM_F_EXCL was set.
--- net/netfilter/nf_tables_api.c | 5 +++++ 1 file changed, 5 insertions(+)
net/netfilter/nf_tables_api.c +5 -0
@@ -4957,6 +4957,11 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set, err = -EBUSY ; else if (!(nlmsg_flags & NLM_F_EXCL)) err =0 ; + }else if (err == -ENOTEMPTY ) { +/* ENOTEMPTY reports overlapping between this element +* and an existing one. +*/ + err = -EEXIST ; } goto err5; }
Signature · 1 line
2.20.1
Re: [PATCH AUTOSEL 5.5 27/35] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
Hi Sasha,
Quoted 3 lines · On Mon, 6 Apr 2020 20:00:49 -0400 Sasha Levin <[email protected]> wrote:
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit
8c2d45b2b65ca1f215244be1c600236e83f9815f]
This patch, together with 28/35 and 29/35 in this series, and all the
equivalent patches for 5.4 and 4.19, that is:
[PATCH AUTOSEL 5.5 27/35] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 5.5 28/35] netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start() [PATCH AUTOSEL 5.5 29/35] netfilter: nft_set_rbtree: Detect partial overlaps on insertion [PATCH AUTOSEL 5.4 24/32] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 5.4 25/32] netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start() [PATCH AUTOSEL 5.4 26/32] netfilter: nft_set_rbtree: Detect partial overlaps on insertion [PATCH AUTOSEL 4.19 08/13] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 4.19 09/13] netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start() [PATCH AUTOSEL 4.19 10/13] netfilter: nft_set_rbtree: Detect partial overlaps on insertion
should only be backported together with nf.git commit
72239f2795fa ("netfilter: nft_set_rbtree: Drop spurious condition for overlap detection on insertion")
as they would otherwise introduce a regression. In general, those changes are not really relevant before 5.6, as nft_set_pipapo wasn't there and the main purpose here is to make the nft_set_rbtree back-end consistent with it:
they also prevent a malfunction in nft_set_rbtree itself, but nothing that would be triggered using 'nft' alone, and no memory badnesses or critical issues whatsoever. So it's also safe to drop them, in my opinion.
Also patches for 4.14 and 4.9:
[PATCH AUTOSEL 4.14 6/9] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 4.9 3/5] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
can safely be dropped, because there are no set back-ends there, without the following patches, that use this way of reporting a partial overlap.
I'm used to not Cc: stable on networking patches (Dave's net.git), but I guess I should instead if they go through nf.git (Pablo's tree), right?
Signature · 1 line
Stefano
Sasha Levin
maintainerRe: [PATCH AUTOSEL 5.5 27/35] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
Quoted 31 lines · Stefano Brivio
Hi Sasha,
Quoted 3 lines · On Mon, 6 Apr 2020 20:00:49 -0400 Sasha Levin <[email protected]> wrote:
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit
8c2d45b2b65ca1f215244be1c600236e83f9815f]This patch, together with 28/35 and 29/35 in this series, and all the
equivalent patches for 5.4 and 4.19, that is:
[PATCH AUTOSEL 5.5 27/35] netfilter:nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 5.5 28/35] netfilter:nft_set_rbtree: Introduce and usenft_rbtree_interval_start()[PATCH AUTOSEL 5.5 29/35] netfilter:nft_set_rbtree: Detect partial overlaps on insertion [PATCH AUTOSEL 5.4 24/32] netfilter:nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 5.4 25/32] netfilter:nft_set_rbtree: Introduce and usenft_rbtree_interval_start()[PATCH AUTOSEL 5.4 26/32] netfilter:nft_set_rbtree: Detect partial overlaps on insertion [PATCH AUTOSEL 4.19 08/13] netfilter:nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 4.19 09/13] netfilter:nft_set_rbtree: Introduce and usenft_rbtree_interval_start()[PATCH AUTOSEL 4.19 10/13] netfilter:nft_set_rbtree: Detect partial overlaps on insertionshould only be backported together with nf.git commit
72239f2795fa("netfilter:nft_set_rbtree: Drop spurious condition for overlap detection on insertion")as they would otherwise introduce a regression. In general, those changes are not really relevant before 5.6, as
nft_set_pipapowasn't there and the main purpose here is to make thenft_set_rbtreeback-end consistent with it:
they also prevent a malfunction innft_set_rbtreeitself, but nothing that would be triggered using 'nft' alone, and no memory badnesses or critical issues whatsoever. So it's also safe to drop them, in my opinion.
Quoted 6 lines
Also patches for 4.14 and 4.9:
[PATCH AUTOSEL 4.14 6/9] netfilter:nf_tables: Allow set back-ends to report partial overlaps on insertion [PATCH AUTOSEL 4.9 3/5] netfilter:nf_tables: Allow set back-ends to report partial overlaps on insertioncan safely be dropped, because there are no set back-ends there, without the following patches, that use this way of reporting a partial overlap.
I've just dropped them all as 72239f2795fa ("netfilter: nft_set_rbtree:
Drop spurious condition for overlap detection on insertion") didn't make it into Linus's tree yet.
Quoted 3 lines
I'm used to not Cc: stable on networking patches (Dave's net.git), but I guess I should instead if they go through nf.git (Pablo's tree), right?
Yup, this confusion has caused for quite a few netfilter fixes to not land in -stable. If it goes through Pablo's tree (and unless he intructs otherwise), you should Cc stable.
Signature · 2 lines
Thanks, Sasha
Re: [PATCH AUTOSEL 5.5 27/35] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
Quoted 9 lines · On Mon, 13 Apr 2020 12:39:00 -0400 Sasha Levin <[email protected]> wrote:
Quoted 3 lines · Stefano Brivio
I'm used to not Cc: stable on networking patches (Dave's net.git), but I guess I should instead if they go through nf.git (Pablo's tree), right?
Yup, this confusion has caused for quite a few netfilter fixes to not land in -stable. If it goes through Pablo's tree (and unless he intructs otherwise), you should Cc stable.
Hah, thanks for clarifying.
What do you think I should do specifically with 72239f2795fa ("netfilter: nft_set_rbtree: Drop spurious condition for overlap detection on insertion")?
I haven't Cc'ed stable on that one. Can I expect AUTOSEL to pick it up anyway?
Signature · 1 line
Stefano
Sasha Levin
maintainerRe: [PATCH AUTOSEL 5.5 27/35] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
Quoted 13 lines · Stefano Brivio
Quoted 9 lines · On Mon, 13 Apr 2020 12:39:00 -0400 Sasha Levin <[email protected]> wrote:
Quoted 3 lines · Stefano Brivio
I'm used to not Cc: stable on networking patches (Dave's net.git), but I guess I should instead if they go through nf.git (Pablo's tree), right?
Yup, this confusion has caused for quite a few netfilter fixes to not land in -stable. If it goes through Pablo's tree (and unless he intructs otherwise), you should Cc stable.
Quoted 8 lines
Hah, thanks for clarifying.
What do you think I should do specifically with
72239f2795fa("netfilter:nft_set_rbtree: Drop spurious condition for overlap detection on insertion")?I haven't Cc'ed stable on that one. Can I expect AUTOSEL to pick it up anyway?
I'll make sure it gets queued up when it hits Linus's tree :)
Signature · 2 lines
Thanks, Sasha
Pablo Neira Ayuso
maintainerRe: [PATCH AUTOSEL 5.5 27/35] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
Hi Sasha,
Quoted 16 lines · Sasha Levin
Quoted 15 lines · Stefano Brivio
Quoted 9 lines · On Mon, 13 Apr 2020 12:39:00 -0400 Sasha Levin <[email protected]> wrote:
Quoted 3 lines · Stefano Brivio
I'm used to not Cc: stable on networking patches (Dave's net.git), but I guess I should instead if they go through nf.git (Pablo's tree), right?
Yup, this confusion has caused for quite a few netfilter fixes to not land in -stable. If it goes through Pablo's tree (and unless he intructs otherwise), you should Cc stable.
Hah, thanks for clarifying.
Quoted 8 lines
Quoted 6 lines
What do you think I should do specifically with
72239f2795fa("netfilter:nft_set_rbtree: Drop spurious condition for overlap detection on insertion")?I haven't Cc'ed stable on that one. Can I expect AUTOSEL to pick it up anyway?
I'll make sure it gets queued up when it hits Linus's tree :)
5.6.6 is out and this fix is still not included...
Would you please enqueue...
commit 72239f2795fab9a58633bd0399698ff7581534a3
Author: Stefano Brivio <[email protected]> Date: Wed Apr 1 17:14:38 2020 +0200
netfilter: nft_set_rbtree: Drop spurious condition for overlap detection on insertion
for 5.6.x -stable ?
Thank you very much.
Re: [PATCH AUTOSEL 5.5 27/35] netfilter: nf_tables: Allow set back-ends to report partial overlaps on insertion
Quoted 32 lines · Pablo Neira Ayuso
Hi Sasha,
Quoted 16 lines · Sasha Levin
Quoted 15 lines · Stefano Brivio
Quoted 9 lines · On Mon, 13 Apr 2020 12:39:00 -0400 Sasha Levin <[email protected]> wrote:
Quoted 3 lines · Stefano Brivio
I'm used to not Cc: stable on networking patches (Dave's net.git), but I guess I should instead if they go through nf.git (Pablo's tree), right?
Yup, this confusion has caused for quite a few netfilter fixes to not land in -stable. If it goes through Pablo's tree (and unless he intructs otherwise), you should Cc stable.
Hah, thanks for clarifying.
Quoted 8 lines
Quoted 6 lines
What do you think I should do specifically with
72239f2795fa("netfilter:nft_set_rbtree: Drop spurious condition for overlap detection on insertion")?I haven't Cc'ed stable on that one. Can I expect AUTOSEL to pick it up anyway?
I'll make sure it gets queued up when it hits Linus's tree :)
5.6.6 is out and this fix is still not included...
Would you please enqueue...
Quoted 7 lines
commit
72239f2795fab9a58633bd0399698ff7581534a3Author: Stefano Brivio <[email protected]> Date: Wed Apr 1 17:14:38 2020 +0200netfilter:
nft_set_rbtree: Drop spurious condition for overlap detection on insertionfor 5.6.x -stable ?
Now queued up, thanks.
greg k-h
Sasha Levin
maintainerPATCH 28/35 netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start()
In reply to Sasha LevinFrom: Stefano Brivio <[email protected]>
[ Upstream commit 6f7c9caf017be8ab0fe3b99509580d0793bf0833 ]
Replace negations of nft_rbtree_interval_end() with a new helper, nft_rbtree_interval_start(), wherever this helps to visualise the problem at hand, that is, for all the occurrences except for the comparison against given flags in __nft_rbtree_get().
This gets especially useful in the next patch.
--- net/netfilter/nft_set_rbtree.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
net/netfilter/nft_set_rbtree.c +11 -6
@@ -33,6 +33,11 @@ static bool nft_rbtree_interval_end(const struct nft_rbtree_elem *rbe) (*nft_set_ext_flags (&rbe->ext) &NFT_SET_ELEM_INTERVAL_END ); } +static bool nft_rbtree_interval_start (const struct nft_rbtree_elem *rbe) +{ +return !nft_rbtree_interval_end (rbe); +} +static bool nft_rbtree_equal (const struct nft_set *set,const void *this,const struct nft_rbtree_elem *interval) {
@@ -64,7 +69,7 @@ static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *setif (interval &&nft_rbtree_equal (set, this, interval) &&nft_rbtree_interval_end (rbe) && - !nft_rbtree_interval_end (interval)) +nft_rbtree_interval_start (interval))continue ; interval = rbe; }else if (d >0 )
@@ -89,7 +94,7 @@ static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *setif (set->flags &NFT_SET_INTERVAL && interval !=NULL &&nft_set_elem_active (&interval->ext, genmask) && - !nft_rbtree_interval_end (interval)) { +nft_rbtree_interval_start (interval)) { *ext = &interval->ext;return true; }
@@ -224,9 +229,9 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set, p = &parent->rb_right; else {if (nft_rbtree_interval_end (rbe) && - !nft_rbtree_interval_end (new)) { +nft_rbtree_interval_start (new)) { p = &parent->rb_left; - }else if (!nft_rbtree_interval_end (rbe) && + }else if (nft_rbtree_interval_start (rbe) &&nft_rbtree_interval_end (new)) { p = &parent->rb_right; }else if (nft_set_elem_active (&rbe->ext, genmask)) {
@@ -317,10 +322,10 @@ static void *nft_rbtree_deactivate(const struct net *net, parent = parent->rb_right; else {if (nft_rbtree_interval_end (rbe) && - !nft_rbtree_interval_end (this)) { +nft_rbtree_interval_start (this)) { parent = parent->rb_left;continue ; - }else if (!nft_rbtree_interval_end (rbe) && + }else if (nft_rbtree_interval_start (rbe) &&nft_rbtree_interval_end (this)) { parent = parent->rb_right;continue ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 29/35 netfilter: nft_set_rbtree: Detect partial overlaps on insertion
In reply to Sasha LevinFrom: Stefano Brivio <[email protected]>
[ Upstream commit 7c84d41416d836ef7e533bd4d64ccbdf40c5ac70 ]
...and return -ENOTEMPTY to the front-end in this case, instead of proceeding. Currently, nft takes care of checking for these cases and not sending them to the kernel, but if we drop the set_overlap() call in nft we can end up in situations like:
# nft add table t
# nft add set t s '{ type inet_service ; flags interval ; }'
# nft add element t s '{ 1 - 5 }'
# nft add element t s '{ 6 - 10 }'
# nft add element t s '{ 4 - 7 }'
# nft list set t s
table ip t {
set s {
type inet_service
flags interval
elements = { 1-3, 4-5, 6-7 }
}
}This change has the primary purpose of making the behaviour consistent with nft_set_pipapo, but is also functional to avoid inconsistent behaviour if userspace sends overlapping elements for any reason.
v2: When we meet the same key data in the tree, as start element while
inserting an end element, or as end element while inserting a start element, actually check that the existing element is active, before resetting the overlap flag (Pablo Neira Ayuso)
--- net/netfilter/nft_set_rbtree.c | 70 ++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-)
net/netfilter/nft_set_rbtree.c +67 -3
@@ -213,8 +213,43 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,u8 genmask =nft_genmask_next (net);struct nft_rbtree_elem *rbe;struct rb_node *parent, **p; +bool overlap = false;int d; +/* Detect overlaps as we descend the tree. Set the flag in these cases: +* +* a1. |__ _ _? >|__ _ _ (insert start after existing start) +* a2. _ _ __>| ?_ _ __| (insert end before existing end) +* a3. _ _ ___| ?_ _ _>| (insert end after existing end) +* a4. >|__ _ _ _ _ __| (insert start before existing end) +* +* and clear it later on, as we eventually reach the points indicated by +* '?' above, in the cases described below. We'll always meet these +* later, locally, due to tree ordering, and overlaps for the intervals +* that are the closest together are always evaluated last. +* +* b1. |__ _ _! >|__ _ _ (insert start after existing end) +* b2. _ _ __>| !_ _ __| (insert end before existing start) +* b3. !_____>| (insert end after existing start) +* +* Case a4. resolves to b1.: +* - if the inserted start element is the leftmost, because the '0' +* element in the tree serves as end element +* - otherwise, if an existing end is found. Note that end elements are +* always inserted after corresponding start elements. +* +* For a new, rightmost pair of elements, we'll hit cases b1. and b3., +* in that order. +* +* The flag is also cleared in two special cases: +* +* b4. |__ _ _!|<_ _ _ (insert start right before existing end) +* b5. |__ _ >|!__ _ _ (insert end right after existing start) +* +* which always happen as last step and imply that no further +* overlapping is possible. +*/ + parent =NULL ; p = &priv->root.rb_node;while (*p !=NULL ) {
@@ -223,17 +258,42 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set, d =memcmp (nft_set_ext_key (&rbe->ext),nft_set_ext_key (&new->ext), set->klen); -if (d <0 ) +if (d <0 ) { p = &parent->rb_left; -else if (d >0 ) + +if (nft_rbtree_interval_start (new)) { + overlap =nft_rbtree_interval_start (rbe) && +nft_set_elem_active (&rbe->ext, + genmask); + }else { + overlap =nft_rbtree_interval_end (rbe) && +nft_set_elem_active (&rbe->ext, + genmask); + } + }else if (d >0 ) { p = &parent->rb_right; -else { + +if (nft_rbtree_interval_end (new)) { + overlap =nft_rbtree_interval_end (rbe) && +nft_set_elem_active (&rbe->ext, + genmask); + }else if (nft_rbtree_interval_end (rbe) && +nft_set_elem_active (&rbe->ext, genmask)) { + overlap = true; + } + }else {if (nft_rbtree_interval_end (rbe) &&nft_rbtree_interval_start (new)) { p = &parent->rb_left; + +if (nft_set_elem_active (&rbe->ext, genmask)) + overlap = false; }else if (nft_rbtree_interval_start (rbe) &&nft_rbtree_interval_end (new)) { p = &parent->rb_right; + +if (nft_set_elem_active (&rbe->ext, genmask)) + overlap = false; }else if (nft_set_elem_active (&rbe->ext, genmask)) { *ext = &rbe->ext;return -EEXIST ;
@@ -242,6 +302,10 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set, } } } + +if (overlap) +return -ENOTEMPTY ; +rb_link_node_rcu (&new->node, parent, p);rb_insert_color (&new->node, &priv->root);return 0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 30/35 cxgb4/ptp: pass the sign of offset delta in FW CMD
In reply to Sasha LevinFrom: Raju Rangoju <[email protected]>
[ Upstream commit 50e0d28d3808146cc19b0d5564ef4ba9e5bf3846 ]
cxgb4_ptp_fineadjtime() doesn't pass the signedness of offset delta in FW_PTP_CMD. Fix it by passing correct sign.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +3 -0
@@ -246,6 +246,9 @@ static int cxgb4_ptp_fineadjtime(struct adapter *adapter, s64 delta) FW_PTP_CMD_PORTID_V(0)); c.retval_len16 =cpu_to_be32 (FW_CMD_LEN16_V (sizeof (c) /16 )); c.u.ts.sc =FW_PTP_SC_ADJ_FTIME ; + c.u.ts.sign = (delta <0 ) ?1 :0 ; +if (delta <0 ) + delta = -delta; c.u.ts.tm =cpu_to_be64 (delta); err =t4_wr_mbox (adapter, adapter->mbox, &c,sizeof (c),NULL );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 31/35 drm/scheduler: fix rare NULL ptr race
In reply to Sasha LevinFrom: Yintian Tao <[email protected]>
[ Upstream commit 3c0fdf3302cb4f186c871684eac5c407a107e480 ]
There is one one corner case at dma_fence_signal_locked which will raise the NULL pointer problem just like below. ->dma_fence_signal
->dma_fence_signal_locked ->test_and_set_bit
here trigger dma_fence_release happen due to the zero of fence refcount.
->dma_fence_put
->dma_fence_release ->drm_sched_fence_release_scheduled ->call_rcu
here make the union fled “cb_list” at finished fence to NULL because struct rcu_head contains two pointer which is same as struct list_head cb_list
Therefore, to hold the reference of finished fence at drm_sched_process_job to prevent the null pointer during finished fence dma_fence_signal
[ 732.912867] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 732.914815] #PF: supervisor write access in kernel mode [ 732.915731] #PF: error_code(0x0002) - not-present page [ 732.916621] PGD 0 P4D 0 [ 732.917072] Oops: 0002 [#1] SMP PTI [ 732.917682] CPU: 7 PID: 0 Comm: swapper/7 Tainted: G OE 5.4.0-rc7 #1 [ 732.918980] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014 [ 732.920906] RIP: 0010:dma_fence_signal_locked+0x3e/0x100 [ 732.938569] Call Trace: [ 732.939003] <IRQ> [ 732.939364] dma_fence_signal+0x29/0x50 [ 732.940036] drm_sched_fence_finished+0x12/0x20 [gpu_sched] [ 732.940996] drm_sched_process_job+0x34/0xa0 [gpu_sched] [ 732.941910] dma_fence_signal_locked+0x85/0x100 [ 732.942692] dma_fence_signal+0x29/0x50 [ 732.943457] amdgpu_fence_process+0x99/0x120 [amdgpu] [ 732.944393] sdma_v4_0_process_trap_irq+0x81/0xa0 [amdgpu]
v2: hold the finished fence at drm_sched_process_job instead of
amdgpu_fence_process
v3: resume the blank line
--- drivers/gpu/drm/scheduler/sched_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/scheduler/sched_main.c +2 -0
@@ -632,7 +632,9 @@ static void drm_sched_process_job(struct dma_fence *f, struct dma_fence_cb *cb)trace_drm_sched_process_job (s_fence); +dma_fence_get (&s_fence->finished);drm_sched_fence_finished (s_fence); +dma_fence_put (&s_fence->finished);wake_up_interruptible (&sched->wake_up_worker); }
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 32/35 cfg80211: Do not warn on same channel at the end of CSA
In reply to Sasha LevinFrom: Ilan Peer <[email protected]>
[ Upstream commit 05dcb8bb258575a8dd3499d0d78bd2db633c2b23 ]
When cfg80211_update_assoc_bss_entry() is called, there is a verification that the BSS channel actually changed. As some APs use CSA also for bandwidth changes, this would result with a kernel warning.
Fix this by removing the WARN_ON().
--- net/wireless/scan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/wireless/scan.c +5 -1
@@ -2022,7 +2022,11 @@ void cfg80211_update_assoc_bss_entry(struct wireless_dev *wdev,spin_lock_bh (&rdev->bss_lock); -if (WARN_ON (cbss->pub.channel == chan)) +/* +* Some APs use CSA also for bandwidth changes, i.e., without actually +* changing the control channel, so no need to update in such a case. +*/ +if (cbss->pub.channel == chan) goto done;/* use transmitting bss */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 33/35 qlcnic: Fix bad kzalloc null test
In reply to Sasha LevinFrom: Xu Wang <[email protected]>
[ Upstream commit bcaeb886ade124331a6f3a5cef34a3f1484c0a03 ]
In qlcnic_83xx_get_reset_instruction_template, the variable of null test is bad, so correct it.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +1 -1
@@ -1720,7 +1720,7 @@ static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_d ahw->reset.seq_error =0 ; ahw->reset.buff =kzalloc (QLC_83XX_RESTART_TEMPLATE_SIZE ,GFP_KERNEL ); -if (p_dev->ahw->reset.buff ==NULL ) +if (ahw->reset.buff ==NULL )return -ENOMEM ; p_buff = p_dev->ahw->reset.buff;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 34/35 i2c: st: fix missing struct parameter description
In reply to Sasha LevinFrom: Alain Volmat <[email protected]>
[ Upstream commit f491c6687332920e296d0209e366fe2ca7eab1c6 ]
Fix a missing struct parameter description to allow warning free W=1 compilation.
--- drivers/i2c/busses/i2c-st.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-st.c +1 -0
@@ -434,6 +434,7 @@ static void st_i2c_wr_fill_tx_fifo(struct st_i2c_dev *i2c_dev)/** * st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode * @i2c_dev: Controller's private data +* @max: Maximum amount of data to fill into the Tx FIFO * * This functions fills the Tx FIFO with fixed pattern when * in read mode to trigger clock.
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 35/35 i2c: pca-platform: Use platform_irq_get_optional
In reply to Sasha LevinFrom: Chris Packham <[email protected]>
[ Upstream commit 14c1fe699cad9cb0acda4559c584f136d18fea50 ]
The interrupt is not required so use platform_irq_get_optional() to avoid error messages like
i2c-pca-platform 22080000.i2c: IRQ index 0 not found
--- drivers/i2c/busses/i2c-pca-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-pca-platform.c +1 -1
@@ -140,7 +140,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)int ret =0 ;int irq; - irq =platform_get_irq (pdev,0 ); + irq =platform_get_irq_optional (pdev,0 );/* If irq is 0, we do polling. */ if (irq <0 ) irq =0 ;
Signature · 1 line
2.20.1