Skip to contentSkip to conversation

wifi: rtw89: leave PS mode before switching chanctx

PATCH In review Ping-Ke Shih 2 participants 2 messages Nov 30 – Dec 2 1 message not in the archive Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw89: leave PS mode before switching chanctx

From: Zong-Zhe Yang <[email protected]>

During switching chanctx, driver needs to configure HW settings for the new chanctx. However, if FW runs with PS mode, it will backup/ restore HW settings when entering/leaving PS mode. So, there may be a racing. Fix it by leaving PS mode first.

When the racing happens, the following logs likely show up.
... read/write rf busy swsi ...

---
 drivers/net/wireless/realtek/rtw89/mac80211.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/realtek/rtw89/mac80211.c +4 -0
index 98f4b5c98f61..801ed6be8d5f 100644
@@ -1416,6 +1416,8 @@ static void rtw89_ops_change_chanctx(struct ieee80211_hw *hw,
 
 	lockdep_assert_wiphy(hw->wiphy);
 
+	rtw89_leave_ps_mode(rtwdev);
+
 	rtw89_chanctx_ops_change(rtwdev, ctx, changed);
 }
 
@@ -1481,6 +1483,8 @@ int rtw89_ops_switch_vif_chanctx(struct ieee80211_hw *hw,
 
 	lockdep_assert_wiphy(hw->wiphy);
 
+	rtw89_leave_ps_mode(rtwdev);
+
 	switch (mode) {
 	case CHANCTX_SWMODE_REASSIGN_VIF:
 		replace = false;

base-commit: ae6b9e98b9045e47f609ec2a8197a3f3109627cb

Signature · 1 line
2.53.0

A message that is not in the archive (sent off-list or not yet received): CAJC97KENZ0EgT5j2Rj-6VMRzF6gu8qqm-r2YOS=CmTw5Qg6v3w@mail.gmail.com

Tested-by
#2 lore raw

Ran it for 1.5 days on RTL8852BE-VT (fw 0.29.122.3, Linux 7.3.6):
6 suspend/resume cycles, 6 APs on 2.4 and 5 GHz, including DFS channel 52. No regressions.

One ECSA occurred on channel 52 ("cannot understand ECSA IE operating class, 3"), with no "rf busy swsi" lines. The AP then disconnected the station, and it reconnected in 7 s. The original hang was rare, so I cannot fully confirm the fix.

Lucca