TencentOS-kernel/drivers/net/wireless
Johannes Berg 91404c2ad9 iwlwifi: pcie: reschedule in long-running memory reads
[ Upstream commit 3d372c4edfd4dffb7dea71c6b096fb414782b776 ]

If we spin for a long time in memory reads that (for some reason in
hardware) take a long time, then we'll eventually get messages such
as

  watchdog: BUG: soft lockup - CPU#2 stuck for 24s! [kworker/2:2:272]

This is because the reading really does take a very long time, and
we don't schedule, so we're hogging the CPU with this task, at least
if CONFIG_PREEMPT is not set, e.g. with CONFIG_PREEMPT_VOLUNTARY=y.

Previously I misinterpreted the situation and thought that this was
only going to happen if we had interrupts disabled, and then fixed
this (which is good anyway, however), but that didn't always help;
looking at it again now I realized that the spin unlock will only
reschedule if CONFIG_PREEMPT is used.

In order to avoid this issue, change the code to cond_resched() if
we've been spinning for too long here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 04516706bb99 ("iwlwifi: pcie: limit memory read spin time")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20210115130253.217a9d6a6a12.If964cb582ab0aaa94e81c4ff3b279eaafda0fd3f@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-04-12 12:51:47 +08:00
..
admtek Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ath wil6210: select CONFIG_CRC32 2021-04-12 12:51:19 +08:00
atmel Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
broadcom brcmfmac: Fix memory leak for unpaired brcmf_{alloc/free} 2021-03-16 16:42:42 +08:00
cisco airo: Fix read overflows sending packets 2021-03-16 16:28:45 +08:00
intel iwlwifi: pcie: reschedule in long-running memory reads 2021-04-12 12:51:47 +08:00
intersil orinoco: Move context allocation after processing the skb 2021-03-16 16:42:52 +08:00
marvell mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start 2021-04-12 12:51:05 +08:00
mediatek mt7601u: fix rx buffer refcounting 2021-04-12 12:51:45 +08:00
quantenna qtnfmac: fix error return code in qtnf_pcie_probe() 2021-03-16 16:42:52 +08:00
ralink Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
realtek rtw88: debug: Fix uninitialized memory in debugfs code 2021-03-16 16:42:07 +08:00
rsi rsi: fix error return code in rsi_reset_card() 2021-03-16 16:42:52 +08:00
st cw1200: fix missing destroy_workqueue() on error in cw1200_init_common 2021-03-16 16:42:52 +08:00
ti wlcore: fix runtime pm imbalance in wlcore_regdomain_config 2021-03-16 16:37:24 +08:00
zydas Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mac80211_hwsim.c mac80211_hwsim: Use kstrndup() in place of kasprintf() 2021-03-16 16:26:26 +08:00
mac80211_hwsim.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ray_cs.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ray_cs.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rayctl.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rndis_wlan.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virt_wifi.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
wl3501.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
wl3501_cs.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00