834021610609cdbfdacda38ec629f7856fa4bc61
[openwrt/openwrt.git] /
1 From 6bdef22d540258ca06f079f7b6ae100669a19b47 Mon Sep 17 00:00:00 2001
2 From: Baochen Qiang <quic_bqiang@quicinc.com>
3 Date: Tue, 3 Jun 2025 10:25:28 +0800
4 Subject: wifi: ath11k: fix sleeping-in-atomic in
5 ath11k_mac_op_set_bitrate_mask()
6
7 [ Upstream commit 65c12b104cb942d588a1a093acc4537fb3d3b129 ]
8
9 ath11k_mac_disable_peer_fixed_rate() is passed as the iterator to
10 ieee80211_iterate_stations_atomic(). Note in this case the iterator is
11 required to be atomic, however ath11k_mac_disable_peer_fixed_rate() does
12 not follow it as it might sleep. Consequently below warning is seen:
13
14 BUG: sleeping function called from invalid context at wmi.c:304
15 Call Trace:
16 <TASK>
17 dump_stack_lvl
18 __might_resched.cold
19 ath11k_wmi_cmd_send
20 ath11k_wmi_set_peer_param
21 ath11k_mac_disable_peer_fixed_rate
22 ieee80211_iterate_stations_atomic
23 ath11k_mac_op_set_bitrate_mask.cold
24
25 Change to ieee80211_iterate_stations_mtx() to fix this issue.
26
27 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
28
29 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
30 Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
31 Link: https://patch.msgid.link/20250603-ath11k-use-non-atomic-iterator-v1-1-d75762068d56@quicinc.com
32 Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
33 Signed-off-by: Sasha Levin <sashal@kernel.org>
34 ---
35 drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++------
36 1 file changed, 6 insertions(+), 6 deletions(-)
37
38 (limited to 'drivers/net/wireless/ath/ath11k')
39
40 --- a/drivers/net/wireless/ath/ath11k/mac.c
41 +++ b/drivers/net/wireless/ath/ath11k/mac.c
42 @@ -8740,9 +8740,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie
43 arvif->vdev_id, ret);
44 return ret;
45 }
46 - ieee80211_iterate_stations_atomic(ar->hw,
47 - ath11k_mac_disable_peer_fixed_rate,
48 - arvif);
49 + ieee80211_iterate_stations_mtx(ar->hw,
50 + ath11k_mac_disable_peer_fixed_rate,
51 + arvif);
52 } else if (ath11k_mac_bitrate_mask_get_single_nss(ar, arvif, band, mask,
53 &single_nss)) {
54 rate = WMI_FIXED_RATE_NONE;
55 @@ -8809,9 +8809,9 @@ ath11k_mac_op_set_bitrate_mask(struct ie
56 }
57
58 mutex_lock(&ar->conf_mutex);
59 - ieee80211_iterate_stations_atomic(ar->hw,
60 - ath11k_mac_disable_peer_fixed_rate,
61 - arvif);
62 + ieee80211_iterate_stations_mtx(ar->hw,
63 + ath11k_mac_disable_peer_fixed_rate,
64 + arvif);
65
66 arvif->bitrate_mask = *mask;
67 ieee80211_iterate_stations_atomic(ar->hw,