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

From: Andy Shevchenko

Date: Sat Feb 14 2026 - 13:24:49 EST


On Sat, Feb 14, 2026 at 12:11:16PM -0600, Ethan Tidmore wrote:
> 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.

...

> > while (pevtpriv->c2h_wk_alive)
> > - msleep(10);
> > + usleep_range(10000, 11000);

The whole approach here seems to be fragile. It should rather use completion
mechanism instead of infinite loop.

> > 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.

Yep.

--
With Best Regards,
Andy Shevchenko