mirror_ubuntu-kernels/drivers/net/wireless/ath/ath11k
Wen Gong 0d7a8a6204 ath11k: fix the warning of dev_wake in mhi_pm_disable_transition()
When test device recovery with below command, it has warning in message
as below.
echo assert > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash
echo assert > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash

warning message:
[ 1965.642121] ath11k_pci 0000:06:00.0: simulating firmware assert crash
[ 1968.471364] ieee80211 phy0: Hardware restart was requested
[ 1968.511305] ------------[ cut here ]------------
[ 1968.511368] WARNING: CPU: 3 PID: 1546 at drivers/bus/mhi/core/pm.c:505 mhi_pm_disable_transition+0xb37/0xda0 [mhi]
[ 1968.511443] Modules linked in: ath11k_pci ath11k mac80211 libarc4 cfg80211 qmi_helpers qrtr_mhi mhi qrtr nvme nvme_core
[ 1968.511563] CPU: 3 PID: 1546 Comm: kworker/u17:0 Kdump: loaded Tainted: G        W         5.17.0-rc3-wt-ath+ #579
[ 1968.511629] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0067.2021.0528.1339 05/28/2021
[ 1968.511704] Workqueue: mhi_hiprio_wq mhi_pm_st_worker [mhi]
[ 1968.511787] RIP: 0010:mhi_pm_disable_transition+0xb37/0xda0 [mhi]
[ 1968.511870] Code: a9 fe ff ff 4c 89 ff 44 89 04 24 e8 03 46 f6 e5 44 8b 04 24 41 83 f8 01 0f 84 21 fe ff ff e9 4c fd ff ff 0f 0b e9 af f8 ff ff <0f> 0b e9 5c f8 ff ff 48 89 df e8 da 9e ee e3 e9 12 fd ff ff 4c 89
[ 1968.511923] RSP: 0018:ffffc900024efbf0 EFLAGS: 00010286
[ 1968.511969] RAX: 00000000ffffffff RBX: ffff88811d241250 RCX: ffffffffc0176922
[ 1968.512014] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff888118a90a24
[ 1968.512059] RBP: ffff888118a90800 R08: 0000000000000000 R09: ffff888118a90a27
[ 1968.512102] R10: ffffed1023152144 R11: 0000000000000001 R12: ffff888118a908ac
[ 1968.512229] R13: ffff888118a90928 R14: dffffc0000000000 R15: ffff888118a90a24
[ 1968.512310] FS:  0000000000000000(0000) GS:ffff888234200000(0000) knlGS:0000000000000000
[ 1968.512405] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1968.512493] CR2: 00007f5538f443a8 CR3: 000000016dc28001 CR4: 00000000003706e0
[ 1968.512587] Call Trace:
[ 1968.512672]  <TASK>
[ 1968.512751]  ? _raw_spin_unlock_irq+0x1f/0x40
[ 1968.512859]  mhi_pm_st_worker+0x3ac/0x790 [mhi]
[ 1968.512959]  ? mhi_pm_mission_mode_transition.isra.0+0x7d0/0x7d0 [mhi]
[ 1968.513063]  process_one_work+0x86a/0x1400
[ 1968.513184]  ? pwq_dec_nr_in_flight+0x230/0x230
[ 1968.513312]  ? move_linked_works+0x125/0x290
[ 1968.513416]  worker_thread+0x6db/0xf60
[ 1968.513536]  ? process_one_work+0x1400/0x1400
[ 1968.513627]  kthread+0x241/0x2d0
[ 1968.513733]  ? kthread_complete_and_exit+0x20/0x20
[ 1968.513821]  ret_from_fork+0x22/0x30
[ 1968.513924]  </TASK>

Reason is mhi_deassert_dev_wake() from mhi_device_put() is called
but mhi_assert_dev_wake() from __mhi_device_get_sync() is not called
in progress of recovery. Commit 8e0559921f ("bus: mhi: core:
Skip device wake in error or shutdown state") add check for the
pm_state of mhi in __mhi_device_get_sync(), and the pm_state is not
the normal state untill recovery is completed, so it leads the
dev_wake is not 0 and above warning print in mhi_pm_disable_transition()
while checking mhi_cntrl->dev_wake.

Add check in ath11k_pci_write32()/ath11k_pci_read32() to skip call
mhi_device_put() if mhi_device_get_sync() does not really do wake,
then the warning gone.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2

Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220228064606.8981-5-quic_wgong@quicinc.com
2022-03-23 10:57:19 +02:00
..
ahb.c ath11k: fix kernel panic during unload/load ath11k modules 2022-01-31 15:59:05 +02:00
ahb.h ath11k: Remove rproc references from common core layer 2020-09-21 16:11:28 +03:00
ce.c ath11k: Disabling credit flow for WMI path 2021-11-17 09:28:04 +02:00
ce.h ath11k: Replace zero-length arrays with flexible-array members 2022-02-21 12:24:34 +02:00
core.c ath11k: add synchronization operation between reconfigure of mac80211 and ath11k_base 2022-03-23 10:56:37 +02:00
core.h ath11k: add synchronization operation between reconfigure of mac80211 and ath11k_base 2022-03-23 10:56:37 +02:00
dbring.c ath11k: add dbring debug support 2022-02-24 11:02:48 +02:00
dbring.h ath11k: add spectral/CFR buffer validation support 2021-12-09 10:14:20 +02:00
debug.c ath11k: add trace log support 2021-11-17 09:29:34 +02:00
debug.h ath11k: add trace log support 2021-11-17 09:29:34 +02:00
debugfs_htt_stats.c ath11k: add HTT stats support for new stats 2021-09-28 16:53:15 +03:00
debugfs_htt_stats.h ath11k: add HTT stats support for new stats 2021-09-28 16:53:15 +03:00
debugfs_sta.c ath11k: report tx bitrate for iw wlan station dump 2021-12-20 20:29:01 +02:00
debugfs_sta.h ath11k: report tx bitrate for iw wlan station dump 2021-12-20 20:29:01 +02:00
debugfs.c ath11k: Add hw-restart option to simulate_fw_crash 2022-03-23 10:56:58 +02:00
debugfs.h ath11k: add dbring debug support 2022-02-24 11:02:48 +02:00
dp_rx.c ath11k: translate HE status to radiotap format 2022-02-24 10:59:41 +02:00
dp_rx.h ath11k: Clear the fragment cache during key install 2021-05-11 20:16:21 +02:00
dp_tx.c Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2022-02-25 11:36:57 +02:00
dp_tx.h ath11k: report tx bitrate for iw wlan station dump 2021-12-20 20:29:01 +02:00
dp.c ath11k: Process full monitor mode rx support 2021-12-09 10:10:33 +02:00
dp.h ath11k: Replace zero-length arrays with flexible-array members 2022-02-21 12:24:34 +02:00
hal_desc.h ath11k: decode HE status tlv 2022-02-24 10:59:20 +02:00
hal_rx.c ath11k: translate HE status to radiotap format 2022-02-24 10:59:41 +02:00
hal_rx.h ath11k: decode HE status tlv 2022-02-24 10:59:20 +02:00
hal_tx.c ath11k: add data path support for QCN9074 2021-02-17 11:32:51 +02:00
hal_tx.h ath11k: add hal support for QCN9074 2021-02-17 11:32:48 +02:00
hal.c ath11k: Avoid false DEADLOCK warning reported by lockdep 2021-12-13 11:49:22 +02:00
hal.h ath11k: Avoid false DEADLOCK warning reported by lockdep 2021-12-13 11:49:22 +02:00
hif.h ath11k: add CE interrupt support for QCN9074 2021-02-17 11:32:58 +02:00
htc.c ath11k: Add basic WoW functionalities 2022-03-18 17:34:37 +02:00
htc.h ath11k: Disabling credit flow for WMI path 2021-11-17 09:28:04 +02:00
hw.c ath11k: Fix missing rx_desc_get_ldpc_support in wcn6855_ops 2022-01-31 16:06:01 +02:00
hw.h ath11k: remove unused ATH11K_BD_IE_BOARD_EXT 2022-03-23 10:52:55 +02:00
Kconfig
mac.c ath11k: add synchronization operation between reconfigure of mac80211 and ath11k_base 2022-03-23 10:56:37 +02:00
mac.h ath11k: Add basic WoW functionalities 2022-03-18 17:34:37 +02:00
Makefile ath11k: Add basic WoW functionalities 2022-03-18 17:34:37 +02:00
mhi.c ath11k: add support for device recovery for QCA6390/WCN6855 2022-03-23 10:56:16 +02:00
mhi.h ath11k: mhi: hook suspend and resume 2020-12-12 06:41:16 +02:00
pci.c ath11k: fix the warning of dev_wake in mhi_pm_disable_transition() 2022-03-23 10:57:19 +02:00
pci.h ath11k: refactor multiple MSI vector implementation 2021-11-22 13:11:02 +02:00
peer.c ath11k: Refactor the peer delete 2022-03-21 12:54:35 +02:00
peer.h ath11k: fix fw crash due to peer get authorized before key install 2021-11-15 11:14:58 +02:00
qmi.c ath11k: change fw build id format in driver init log 2022-03-21 12:55:44 +02:00
qmi.h ath11k: add ath11k_qmi_free_resource() for recovery 2022-02-21 12:04:59 +02:00
reg.c ath11k: avoid firmware crash when reg set for QCA6390/WCN6855 2022-01-28 14:36:26 +02:00
reg.h ath11k: Avoid race during regd updates 2021-09-28 13:57:32 +03:00
rx_desc.h ath11k: Replace zero-length arrays with flexible-array members 2022-02-21 12:24:34 +02:00
spectral.c ath11k: Replace zero-length arrays with flexible-array members 2022-02-21 12:24:34 +02:00
spectral.h
testmode_i.h
testmode.c ath11k: remove repeated words in comments and warnings 2020-10-28 15:44:04 +02:00
testmode.h
thermal.c net: ath11k: constify ath11k_thermal_ops 2020-08-26 16:21:17 -07:00
thermal.h
trace.c ath11k: add trace log support 2021-11-17 09:29:34 +02:00
trace.h ath11k: add support of firmware logging for WCN6855 2021-12-22 08:03:13 +02:00
wmi.c ath11k: support GTK rekey offload 2022-03-18 17:36:23 +02:00
wmi.h ath11k: support GTK rekey offload 2022-03-18 17:36:23 +02:00
wow.c ath11k: support GTK rekey offload 2022-03-18 17:36:23 +02:00
wow.h ath11k: Add basic WoW functionalities 2022-03-18 17:34:37 +02:00