diff mbox series

[v2,1/7] wifi: rtw88: add mutex when set SAR

Message ID 20220809084107.38137-2-pkshih@realtek.com (mailing list archive)
State Accepted
Commit 9a72db41338564040b6469342cfddd46568c7380
Delegated to: Kalle Valo
Headers show
Series wifi: rtw88: add proper mutex lock to safely access channel | expand

Commit Message

Ping-Ke Shih Aug. 9, 2022, 8:41 a.m. UTC
From: Chih-Kang Chang <gary.chang@realtek.com>

Applying SAR will access hal data, it should hold rtwdev::mutex
to avoid hal data changed during setting flow.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/mac80211.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kalle Valo Aug. 10, 2022, 5:49 a.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> wrote:

> From: Chih-Kang Chang <gary.chang@realtek.com>
> 
> Applying SAR will access hal data, it should hold rtwdev::mutex
> to avoid hal data changed during setting flow.
> 
> Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

7 patches applied to wireless-next.git, thanks.

9a72db413385 wifi: rtw88: add mutex when set SAR
685b474b7d8a wifi: rtw88: add mutex when set regulatory and get Tx power table
341dd1f7de4c wifi: rtw88: add the update channel flow to support setting by parameters
68c539144397 wifi: rtw88: fix WARNING:rtw_get_tx_power_params() during HW scan
d08458b57a50 wifi: rtw88: add flushing queue before HW scan
6bf3a083407b wifi: rtw88: add flag check before enter or leave IPS
7dad3e39fde1 wifi: rtw88: prohibit enter IPS during HW scan
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index b6af199ae5e11..fa6a920fa8054 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -875,7 +875,9 @@  static int rtw_ops_set_sar_specs(struct ieee80211_hw *hw,
 {
 	struct rtw_dev *rtwdev = hw->priv;
 
+	mutex_lock(&rtwdev->mutex);
 	rtw_set_sar_specs(rtwdev, sar);
+	mutex_unlock(&rtwdev->mutex);
 
 	return 0;
 }