Re: [PATCH] staging: rtl8723bs: fix scan-abort timeout in rtw_scan_abort()
From: Greg Kroah-Hartman
Date: Wed Sep 30 2026 - 00:38:14 EST
On Wed, Sep 30, 2026 at 09:50:24AM +0800, Gongwei Li wrote:
> From: Gongwei Li <ligongwei@xxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxxx
> Signed-off-by: Gongwei Li <ligongwei@xxxxxxxxxx>
> ---
> 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