staging: rtl8723bs: Replace msleep with usleep_range
PATCH 1/1 staging: rtl8723bs: Replace msleep with usleep_range
The checkpatch.pl script flagged a warning regarding the use of msleep() for less than 20ms. msleep() relies on jiffies and can be inaccurate for short durations, leading to inefficient delays.
Replace msleep(10) with usleep_range(10000, 12000) to allow for timer coalescing. This gives the kernel scheduler a 2ms window to group wakeups, improving overall system power efficiency while maintaining the required 10ms minimum delay.
--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -1
@@ -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 ,12000 );while (!rtw_cbuf_empty (pevtpriv->c2h_queue)) {void *c2h =rtw_cbuf_pop (pevtpriv->c2h_queue);
Signature · 1 line
2.53.0
Quoted 11 lines · AyushMukkanwar
The checkpatch.pl script flagged a warning regarding the use of
msleep()for less than 20ms.msleep()relies on jiffies and can be inaccurate for short durations, leading to inefficient delays.Replace msleep(10) with
usleep_range(10000, 12000)to allow for timer coalescing. This gives the kernel scheduler a 2ms window to group wakeups, improving overall system power efficiency while maintaining the required 10ms minimum delay.Signed-off-by AyushMukkanwar <[email protected]>---
Greg has already NAKed this change.
Thanks,
ET
Quoted 8 lines · AyushMukkanwar
The checkpatch.pl script flagged a warning regarding the use of
msleep()for less than 20ms.msleep()relies on jiffies and can be inaccurate for short durations, leading to inefficient delays.Replace msleep(10) with
usleep_range(10000, 12000)to allow for timer coalescing. This gives the kernel scheduler a 2ms window to group wakeups, improving overall system power efficiency while maintaining the required 10ms minimum delay.
The new API is fsleep().
Signature · 2 lines
With Best Regards, Andy Shevchenko