mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: fix scan-abort timeout in rtw_scan_abort()
@ 2026-09-30  1:50 Gongwei Li
  2026-09-30  4:38 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Gongwei Li @ 2026-09-30  1:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging
  Cc: Hans de Goede, Dan Carpenter, linux-kernel, stable, Gongwei Li

From: Gongwei Li <ligongwei@kylinos.cn>

rtw_scan_abort() checks jiffies_to_msecs(start) <= 200, but start holds
an absolute jiffies value, so this converts the time since boot rather
than the elapsed time. Once the system has been up for more than 200ms
the condition is always false and the loop never waits for an ongoing
scan to finish.

Use jiffies_to_msecs(jiffies - start) to get the real elapsed time.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Gongwei Li <ligongwei@kylinos.cn>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index d18768a51b19..d4beff59f272 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -931,7 +931,7 @@ void rtw_scan_abort(struct adapter *adapter)
 	start = jiffies;
 	pmlmeext->scan_abort = true;
 	while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
-	       && jiffies_to_msecs(start) <= 200) {
+	       && jiffies_to_msecs(jiffies - start) <= 200) {
 		if (adapter->driver_stopped || adapter->bSurpriseRemoved)
 			break;
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-30  6:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30  1:50 [PATCH] staging: rtl8723bs: fix scan-abort timeout in rtw_scan_abort() Gongwei Li
2026-09-30  4:38 ` Greg Kroah-Hartman
2026-09-30  6:27   ` Gongwei Li
2026-09-30  6:38     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®