staging: rtl8723bs: replace msleep with usleep_range in rtw_dev_unload
PATCH 1/1 staging: rtl8723bs: replace msleep with usleep_range in rtw_dev_unload
Replace msleep(10) with usleep_range(10000, 20000) in the command thread shutdown loop in rtw_dev_unload(), since msleep() for values less than 20ms may not in fact sleep for the intended duration and will often sleep for up to 20ms, as documented in Documentation/timers/timers-howto.rst.
Also remove the unnecessary else branch after break and the associated if braces to simplify the loop.
--- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +4 -5
@@ -986,12 +986,11 @@ void rtw_dev_unload(struct adapter *padapter)rtw_stop_drv_threads (padapter);while (atomic_read (&pcmdpriv->cmdthd_running)) { -if (cnt >5 ) { +if (cnt >5 )break ; - }else { - cnt++; -msleep (10 ); - } + + cnt++; +usleep_range (10000 ,20000 ); }/* check the status of IPS */
Signature · 1 line
2.53.0
Quoted 6 lines · Gustavo Arantes
Replace msleep(10) with
usleep_range(10000, 20000)in the command thread shutdown loop inrtw_dev_unload(), sincemsleep()for values less than 20ms may not in fact sleep for the intended duration and will often sleep for up to 20ms, as documented inDocumentation/timers/timers-howto.rst.
This has been addressed in a thread recently and Gred said to drop the patch [1].
Best,
Bryant Boatright
[1] https://lore.kernel.org/linux-staging/[email protected]/