wifi: ath12k: fix context switch in panic notifier issue#915
Open
MilanoPipo wants to merge 1 commit intoqualcomm-linux:tech/net/athfrom
Open
wifi: ath12k: fix context switch in panic notifier issue#915MilanoPipo wants to merge 1 commit intoqualcomm-linux:tech/net/athfrom
MilanoPipo wants to merge 1 commit intoqualcomm-linux:tech/net/athfrom
Conversation
Call Stack: Voluntary context switch within RCU read-side critical section! WARNING: kernel/rcu/tree_plugin.h:332 at rcu_note_context_switch+0x4c4/0x508, CPU#1: bash/817 CPU: 1 UID: 0 PID: 817 Comm: bash Tainted: G W 7.0.0-rc3 qualcomm-linux#1 PREEMPT Tainted: [W]=WARN Hardware name: Qualcomm Technologies, Inc. Hamoa IoT EVK (DT) pstate: 614000c5 (nZCv daIF +PAN -UAO -TCO +DIT -SSBS BTYPE=--) pc : rcu_note_context_switch+0x4c4/0x508 lr : rcu_note_context_switch+0x4c4/0x508 sp : ffff800085eeb7f0 x29: ffff800085eeb7f0 x28: ffff0008044fd640 x27: 0000000000000000 x26: 0000000000000000 x25: ffffd83dbc89c100 x24: ffff00081e668000 x23: 0000000000000000 x22: ffff0008044fd640 x21: ffffd83dbd9a6760 x20: 0000000000000000 x19: ffff008f386a2040 x18: 0000000000003fb8 x17: 2020202020202020 x16: ffffd83dbb6147b0 x15: 00000000000006a7 x14: 0000000000000001 x13: 00000000000006a6 x12: 00000000fffff6a5 x11: ffffd83dbd3b2a90 x10: ffffd83dbd414a88 x9 : ffffd83dbd3b2b10 x8 : ffffd83dbd40ab10 x7 : 0000000000003f70 x6 : 00000000000006a5 x5 : ffff008f3868d448 x4 : 80000000fffff6a5 x3 : ffff28517be05000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0008044fd640 Call trace: rcu_note_context_switch+0x4c4/0x508 (P) __schedule+0xbc/0x1204 schedule+0x34/0x110 schedule_timeout+0x84/0x11c __mhi_device_get_sync+0x164/0x228 [mhi] mhi_device_get_sync+0x1c/0x3c [mhi] ath12k_wifi7_pci_bus_wake_up+0x20/0x2c [ath12k_wifi7] ath12k_pci_read32+0x58/0x350 [ath12k] ath12k_pci_clear_dbg_registers+0x28/0xb8 [ath12k] ath12k_pci_panic_handler+0x20/0x44 [ath12k] ath12k_core_panic_handler+0x28/0x3c [ath12k] notifier_call_chain+0x78/0x1c0 atomic_notifier_call_chain+0x3c/0x5c In ath12k_pci_panic_handler() many reset related registers need to be read/written. Since Q6 can be in a power‑saving mode (M1/M2), the common PCI read/write APIs in ath12k explicitly wake up Q6 and wait until it reaches the M0 state before issuing the read/write. The wait may result in a context switch. Panic handler is in a atomic RCU read process, we need to avoid context switch in this process. Add a flag to avoid waking up Q6 in panic handler process. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3 Signed-off-by: Yingying Tang <yingying.tang@oss.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Call Stack:
Voluntary context switch within RCU read-side critical section! WARNING: kernel/rcu/tree_plugin.h:332 at rcu_note_context_switch+0x4c4/0x508, CPU#1: bash/817
CPU: 1 UID: 0 PID: 817 Comm: bash Tainted: G W 7.0.0-rc3 #1 PREEMPT
Tainted: [W]=WARN
Hardware name: Qualcomm Technologies, Inc. Hamoa IoT EVK (DT)
pstate: 614000c5 (nZCv daIF +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
pc : rcu_note_context_switch+0x4c4/0x508
lr : rcu_note_context_switch+0x4c4/0x508
sp : ffff800085eeb7f0
x29: ffff800085eeb7f0 x28: ffff0008044fd640 x27: 0000000000000000
x26: 0000000000000000 x25: ffffd83dbc89c100 x24: ffff00081e668000
x23: 0000000000000000 x22: ffff0008044fd640 x21: ffffd83dbd9a6760
x20: 0000000000000000 x19: ffff008f386a2040 x18: 0000000000003fb8
x17: 2020202020202020 x16: ffffd83dbb6147b0 x15: 00000000000006a7
x14: 0000000000000001 x13: 00000000000006a6 x12: 00000000fffff6a5
x11: ffffd83dbd3b2a90 x10: ffffd83dbd414a88 x9 : ffffd83dbd3b2b10
x8 : ffffd83dbd40ab10 x7 : 0000000000003f70 x6 : 00000000000006a5
x5 : ffff008f3868d448 x4 : 80000000fffff6a5 x3 : ffff28517be05000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0008044fd640
Call trace:
rcu_note_context_switch+0x4c4/0x508 (P)
__schedule+0xbc/0x1204
schedule+0x34/0x110
schedule_timeout+0x84/0x11c
__mhi_device_get_sync+0x164/0x228 [mhi]
mhi_device_get_sync+0x1c/0x3c [mhi]
ath12k_wifi7_pci_bus_wake_up+0x20/0x2c [ath12k_wifi7]
ath12k_pci_read32+0x58/0x350 [ath12k]
ath12k_pci_clear_dbg_registers+0x28/0xb8 [ath12k]
ath12k_pci_panic_handler+0x20/0x44 [ath12k]
ath12k_core_panic_handler+0x28/0x3c [ath12k]
notifier_call_chain+0x78/0x1c0
atomic_notifier_call_chain+0x3c/0x5c
In ath12k_pci_panic_handler() many reset related registers need to be read/written.
Since Q6 can be in a power‑saving mode (M1/M2), the common PCI read/write APIs in ath12k explicitly wake up Q6 and wait until it reaches the M0 state before issuing the read/write. The wait may result in a context switch.
Panic handler is in a atomic RCU read process, we need to avoid context switch in this process.
Add a flag to avoid waking up Q6 in panic handler process.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3