bianbu-linux-6.6/drivers/net/wireless/ath/ath10k
Douglas Anderson a48cb9c6ad wifi: ath10k: Don't touch the CE interrupt registers after power up
[ Upstream commit 170c75d43a77dc937c58f07ecf847ba1b42ab74e ]

As talked about in commit d66d24ac30 ("ath10k: Keep track of which
interrupts fired, don't poll them"), if we access the copy engine
register at a bad time then ath10k can go boom. However, it's not
necessarily easy to know when it's safe to access them.

The ChromeOS test labs saw a crash that looked like this at
shutdown/reboot time (on a chromeos-5.15 kernel, but likely the
problem could also reproduce upstream):

Internal error: synchronous external abort: 96000010 [#1] PREEMPT SMP
...
CPU: 4 PID: 6168 Comm: reboot Not tainted 5.15.111-lockdep-19350-g1d624fe6758f #1 010b9b233ab055c27c6dc88efb0be2f4e9e86f51
Hardware name: Google Kingoftown (DT)
...
pc : ath10k_snoc_read32+0x50/0x74 [ath10k_snoc]
lr : ath10k_snoc_read32+0x24/0x74 [ath10k_snoc]
...
Call trace:
ath10k_snoc_read32+0x50/0x74 [ath10k_snoc ...]
ath10k_ce_disable_interrupt+0x190/0x65c [ath10k_core ...]
ath10k_ce_disable_interrupts+0x8c/0x120 [ath10k_core ...]
ath10k_snoc_hif_stop+0x78/0x660 [ath10k_snoc ...]
ath10k_core_stop+0x13c/0x1ec [ath10k_core ...]
ath10k_halt+0x398/0x5b0 [ath10k_core ...]
ath10k_stop+0xfc/0x1a8 [ath10k_core ...]
drv_stop+0x148/0x6b4 [mac80211 ...]
ieee80211_stop_device+0x70/0x80 [mac80211 ...]
ieee80211_do_stop+0x10d8/0x15b0 [mac80211 ...]
ieee80211_stop+0x144/0x1a0 [mac80211 ...]
__dev_close_many+0x1e8/0x2c0
dev_close_many+0x198/0x33c
dev_close+0x140/0x210
cfg80211_shutdown_all_interfaces+0xc8/0x1e0 [cfg80211 ...]
ieee80211_remove_interfaces+0x118/0x5c4 [mac80211 ...]
ieee80211_unregister_hw+0x64/0x1f4 [mac80211 ...]
ath10k_mac_unregister+0x4c/0xf0 [ath10k_core ...]
ath10k_core_unregister+0x80/0xb0 [ath10k_core ...]
ath10k_snoc_free_resources+0xb8/0x1ec [ath10k_snoc ...]
ath10k_snoc_shutdown+0x98/0xd0 [ath10k_snoc ...]
platform_shutdown+0x7c/0xa0
device_shutdown+0x3e0/0x58c
kernel_restart_prepare+0x68/0xa0
kernel_restart+0x28/0x7c

Though there's no known way to reproduce the problem, it makes sense
that it would be the same issue where we're trying to access copy
engine registers when it's not allowed.

Let's fix this by changing how we "disable" the interrupts. Instead of
tweaking the copy engine registers we'll just use disable_irq() and
enable_irq(). Then we'll configure the interrupts once at power up
time.

Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230630151842.1.If764ede23c4e09a43a842771c2ddf99608f25f8e@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 17:19:38 +00:00
..
ahb.c wifi: ath10k: fix Wvoid-pointer-to-enum-cast warning 2023-08-23 17:10:04 +03:00
ahb.h
bmi.c wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
bmi.h treewide: Replace 0-element memcpy() destinations with flexible arrays 2021-10-18 12:28:53 -07:00
ce.c wifi: ath10k: remove unused ath10k_get_ring_byte function 2023-03-24 16:52:57 +02:00
ce.h
core.c wifi: ath10k: Trigger STA disconnect after reconfig complete on hardware restart 2023-06-01 13:32:13 +03:00
core.h wifi: ath10k: Serialize wake_tx_queue ops 2023-05-05 16:01:09 +03:00
coredump.c wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
coredump.h wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
debug.c wifi: ath10k: fix clang-specific fortify warning 2023-11-28 17:19:37 +00:00
debug.h
debugfs_sta.c wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
hif.h
htc.c wifi: ath10k: Delay the unmapping of the buffer 2022-10-19 08:44:34 +03:00
htc.h
htt.c ath10k: abstract htt_rx_desc structure 2022-01-17 14:45:15 +02:00
htt.h wifi: ath10k: Fix a few spelling errors 2023-08-23 17:05:25 +03:00
htt_rx.c wifi: ath10k: Remove redundant argument offset 2022-11-17 14:57:35 +02:00
htt_tx.c wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
hw.c wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
hw.h wifi: ath10k: Delay the unmapping of the buffer 2022-10-19 08:44:34 +03:00
Kconfig wifi: ath10k: fix QCOM_SMEM dependency 2022-12-02 20:24:06 +02:00
mac.c wifi: ath10k: Trigger STA disconnect after reconfig complete on hardware restart 2023-06-01 13:32:13 +03:00
mac.h
Makefile
p2p.c
p2p.h
pci.c pci-v6.6-changes 2023-08-30 20:23:07 -07:00
pci.h wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
qmi.c wifi: ath10/11/12k: Use alloc_ordered_workqueue() to create ordered workqueues 2023-05-18 14:40:31 -10:00
qmi.h
qmi_wlfw_v01.c wifi: ath10k: Make QMI message rules const 2022-11-03 08:06:52 +02:00
qmi_wlfw_v01.h wifi: ath10k: Make QMI message rules const 2022-11-03 08:06:52 +02:00
rx_desc.h wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
sdio.c wifi: ath10k: Fix a few spelling errors 2023-08-23 17:05:25 +03:00
sdio.h
snoc.c wifi: ath10k: Don't touch the CE interrupt registers after power up 2023-11-28 17:19:38 +00:00
snoc.h
spectral.c
spectral.h
swap.c
swap.h ath10k: Replace zero-length array with flexible-array member 2022-02-21 12:23:28 +02:00
targaddrs.h
testmode.c
testmode.h
testmode_i.h
thermal.c wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
thermal.h wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
trace.c
trace.h tracing/ath: Use the new __vstring() helper 2022-07-15 17:44:40 -04:00
txrx.c ath10k: improve tx status reporting 2022-05-22 15:27:51 +03:00
txrx.h
usb.c Fix nomenclature for USB and PCI wireless devices 2023-08-25 12:56:49 +03:00
usb.h wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
wmi-ops.h
wmi-tlv.c wifi: ath10k: Check return value of ath10k_get_arvif() in ath10k_wmi_event_tdls_peer() 2022-10-13 09:20:45 +03:00
wmi-tlv.h wifi: ath10k: Fix miscellaneous spelling errors 2022-09-16 12:18:51 +03:00
wmi.c wifi: ath10k: Use list_count_nodes() 2023-05-05 16:07:45 +03:00
wmi.h wifi: ath10k: Fix a few spelling errors 2023-08-23 17:05:25 +03:00
wow.c ath10k: fix memory overwrite of the WoWLAN wakeup packet pattern 2022-01-11 16:30:14 +02:00
wow.h