Re: [PATCH] staging: rtl8723bs: replace msleep with usleep_range

From: Ethan Tidmore

Date: Sat Feb 14 2026 - 13:12:08 EST


On Sat Feb 14, 2026 at 11:31 AM CST, Ofek Almog wrote:
> This patch replaces msleep(10) with usleep_range(10000, 11000) to provide
> more precise delay handling while allowing the timer subsystem to coalesce
> timers efficiently.
>
> Signed-off-by: Ofek Almog <ofekalm100@xxxxxxxxx>
> ---
> drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index b2e7f479f72b..3f5b3ca2066d 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -214,7 +214,7 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
> {
> _cancel_workitem_sync(&pevtpriv->c2h_wk);
> while (pevtpriv->c2h_wk_alive)
> - msleep(10);
> + usleep_range(10000, 11000);
>
> while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
> void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);

Shouldn't we be using fsleep() now instead of replacing msleep() with
usleep_range() when the time is sub 20ms?

I feel like I read Andy Shevchenko mention this elsewhere.

Thanks,

ET