Commit 6db2329
wifi: ath11k: use work queue to process beacon tx event
[ Upstream commit 177b49d ]
Commit 3a415da ("wifi: ath11k: add P2P IE in beacon template")
from Feb 28, 2024 (linux-next), leads to the following Smatch static
checker warning:
drivers/net/wireless/ath/ath11k/wmi.c:1742 ath11k_wmi_p2p_go_bcn_ie()
warn: sleeping in atomic context
The reason is that ath11k_bcn_tx_status_event() will directly call might
sleep function ath11k_wmi_cmd_send() during RCU read-side critical
sections. The call trace is like:
ath11k_bcn_tx_status_event()
-> rcu_read_lock()
-> ath11k_mac_bcn_tx_event()
-> ath11k_mac_setup_bcn_tmpl()
……
-> ath11k_wmi_bcn_tmpl()
-> ath11k_wmi_cmd_send()
-> rcu_read_unlock()
Commit 886433a ("ath11k: add support for BSS color change") added the
ath11k_mac_bcn_tx_event(), commit 01e782c ("ath11k: fix warning
of RCU usage for ath11k_mac_get_arvif_by_vdev_id()") added the RCU lock
to avoid warning but also introduced this BUG.
Use work queue to avoid directly calling ath11k_mac_bcn_tx_event()
during RCU critical sections. No need to worry about the deletion of vif
because cancel_work_sync() will drop the work if it doesn't start or
block vif deletion until the running work is done.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
Fixes: 3a415da ("wifi: ath11k: add P2P IE in beacon template")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/2d277abd-5e7b-4da0-80e0-52bd96337f6e@moroto.mountain/
Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20240626053543.1946-1-quic_kangyang@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 7424ab4 commit 6db2329
3 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| 402 | + | |
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6599 | 6599 | | |
6600 | 6600 | | |
6601 | 6601 | | |
| 6602 | + | |
| 6603 | + | |
| 6604 | + | |
| 6605 | + | |
| 6606 | + | |
| 6607 | + | |
| 6608 | + | |
| 6609 | + | |
| 6610 | + | |
| 6611 | + | |
6602 | 6612 | | |
6603 | 6613 | | |
6604 | 6614 | | |
| |||
6637 | 6647 | | |
6638 | 6648 | | |
6639 | 6649 | | |
| 6650 | + | |
6640 | 6651 | | |
6641 | 6652 | | |
6642 | 6653 | | |
| |||
6879 | 6890 | | |
6880 | 6891 | | |
6881 | 6892 | | |
| 6893 | + | |
6882 | 6894 | | |
6883 | 6895 | | |
6884 | 6896 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7404 | 7404 | | |
7405 | 7405 | | |
7406 | 7406 | | |
7407 | | - | |
| 7407 | + | |
| 7408 | + | |
| 7409 | + | |
7408 | 7410 | | |
7409 | 7411 | | |
7410 | 7412 | | |
| |||
0 commit comments