staging: rtl8723bs: replace msleep with usleep_range in _rtw_free_evt_priv
PATCH 1/1 staging: rtl8723bs: replace msleep with usleep_range in _rtw_free_evt_priv
The msleep(10) call is an imprecise busy-wait function in core/rtw_cmd.c/_rtw_free_evt_priv due to timer jitter.
Replace it with usleep_range(10000, 11000) to save CPU cycles to provide more precise timing.
Signed-off-by Marco Lu <[email protected]>
--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +1 -2
@@ -214,8 +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);
Signature · 1 line
2.53.0
Quoted 8 lines · Marco Lu
The msleep(10) call is an imprecise busy-wait function in core/rtw_cmd.c/_rtw_free_evt_priv due to timer jitter.
Replace it with
usleep_range(10000, 11000)to save CPU cycles to provide more precise timing.Signed-off-by Marco Lu <[email protected]>---
This has been NAKed in the past by Greg. Also, fsleep() is the new API.
Thanks,
ET