* [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
* Re: [PATCH] staging: rtl8723bs: fix scan-abort timeout in rtw_scan_abort()
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
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-09-30 4:38 UTC (permalink / raw)
To: Gongwei Li
Cc: linux-staging, Hans de Goede, Dan Carpenter, linux-kernel,
stable, Gongwei Li
On Wed, Sep 30, 2026 at 09:50:24AM +0800, Gongwei Li wrote:
> 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;
>
How was this found and tested?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8723bs: fix scan-abort timeout in rtw_scan_abort()
2026-09-30 4:38 ` Greg Kroah-Hartman
@ 2026-09-30 6:27 ` Gongwei Li
2026-09-30 6:38 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Gongwei Li @ 2026-09-30 6:27 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-staging, Hans de Goede, Dan Carpenter, linux-kernel, stable
> How was this found and tested?
Every other jiffies_to_msecs() call in this driver passes an elapsed
time (jiffies - x), but this loop hands it the absolute start value,
and the check never passes.
I haven't tested it on real hardware. I don't have an rtl8723bs device.
Thanks,
Gongwei Li
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8723bs: fix scan-abort timeout in rtw_scan_abort()
2026-09-30 6:27 ` Gongwei Li
@ 2026-09-30 6:38 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-09-30 6:38 UTC (permalink / raw)
To: Gongwei Li
Cc: linux-staging, Hans de Goede, Dan Carpenter, linux-kernel, stable
On Wed, Sep 30, 2026 at 02:27:08PM +0800, Gongwei Li wrote:
> > How was this found and tested?
>
> Every other jiffies_to_msecs() call in this driver passes an elapsed
> time (jiffies - x), but this loop hands it the absolute start value,
> and the check never passes.
>
> I haven't tested it on real hardware. I don't have an rtl8723bs device.
Ok, let's wait until you can do that as I don't want to break anything
as obviously this works as-is today.
thanks,
greg k-h
^ 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®