Skip to contentSkip to conversation

wifi: rtw89: fix HW scan abort not completed issue

PATCH In review Ping-Ke Shih 1 participant 2 messages May 10, 2024 – May 14, 2024 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw89: fix HW scan abort not completed issue

From: Chih-Kang Chang <[email protected]>

When scan happens before suspending, rtw89_hw_scan_complete() might happen after suspend flow. This causes the scan to be unable to properly indicate scan completion to mac80211 before suspending. To fix this issue, we modify to execute rtw89_hw_scan_complete() when rtw89_hw_scan_abort() is called, regardless of result of rtw89_hw_scan_offload().

Fixes bcbefbd032df ("wifi: rtw89: add wait/completion for abort scan")
---
 drivers/net/wireless/realtek/rtw89/fw.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw89/fw.c +4 -2
index 044a5b90c7f4..e9aa5bdeb5d7 100644
@@ -6212,7 +6212,7 @@ void rtw89_hw_scan_complete(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif,
 		.aborted = aborted,
 	};
 
-	if (!vif)
+	if (!vif || !rtwdev->scanning)
 		return;
 
 	rtw89_write32_mask(rtwdev,
@@ -6245,7 +6245,9 @@ void rtw89_hw_scan_abort(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif)
 
 	ret = rtw89_hw_scan_offload(rtwdev, vif, false);
 	if (ret)
-		rtw89_hw_scan_complete(rtwdev, vif, true);
+		rtw89_warn(rtwdev, "rtw89_hw_scan_offload failed ret %d\n", ret);
+
+	rtw89_hw_scan_complete(rtwdev, vif, true);
 }
 
 static bool rtw89_is_any_vif_connected_or_connecting(struct rtw89_dev *rtwdev)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw
Quoted 9 lines · Ping-Ke Shih

From: Chih-Kang Chang <[email protected]>

When scan happens before suspending, rtw89_hw_scan_complete() might happen after suspend flow. This causes the scan to be unable to properly indicate scan completion to mac80211 before suspending. To fix this issue, we modify to execute rtw89_hw_scan_complete() when rtw89_hw_scan_abort() is called, regardless of result of rtw89_hw_scan_offload().

Quoted 4 lines
Fixes bcbefbd032df ("wifi: rtw89: add wait/completion for abort scan")

It seems have better way to fix this problem. Drop this patch for now.