From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Cc: <gary.chang@realtek.com>
Subject: [PATCH] wifi: rtw89: fix HW scan abort not completed issue
Date: Fri, 10 May 2024 21:09:34 +0800 [thread overview]
Message-ID: <20240510130934.5825-1-pkshih@realtek.com> (raw)
From: Chih-Kang Chang <gary.chang@realtek.com>
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().
Cc: stable@vger.kernel.org
Fixes: bcbefbd032df ("wifi: rtw89: add wait/completion for abort scan")
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtw89/fw.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index 044a5b90c7f4..e9aa5bdeb5d7 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -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)
--
2.25.1
next reply other threads:[~2024-05-10 13:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 13:09 Ping-Ke Shih [this message]
2024-05-14 1:40 ` [PATCH] wifi: rtw89: fix HW scan abort not completed issue Ping-Ke Shih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240510130934.5825-1-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=gary.chang@realtek.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).