* [PATCH] staging: rtl8723bs: os_intfs: replace msleep with usleep_range
@ 2026-07-29 5:20 Connor Sample
0 siblings, 0 replies; only message in thread
From: Connor Sample @ 2026-07-29 5:20 UTC (permalink / raw)
To: linux-staging
Cc: Connor Sample, Greg Kroah-Hartman, Ethan Tidmore, Nikolay Kulikov,
Dan Carpenter, Luka Gejak, Khushal Chitturi, Hungyu Lin,
Samasth Norway Ananda, Adrish Bora, Shyam Sunder Reddy Padira
checkpatch.pl warns that `msleep()` of durations <20ms may sleep for up
to 20ms. As per `Documentation/timers/delay_sleep_functions.rst`,
`usleep_range()` should be used whenever the accuracy of `msleep()` is
not sufficient in order to avoid jiffy rounding.
Replaced `msleep(10)` with `usleep_range(10000, 11000)` and replaced a
1ms polling loop (`msleep(1)`) with `usleep_range(1000, 2000)`. This
should provide improved scheduling tolerances without changing the
minimum delay expectation for the hardware.
Signed-off-by: Connor Sample <tabulatejarl8@gmail.com>
---
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index f31196f54b3e..ccac4c2c3269 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -992,7 +992,7 @@ void rtw_dev_unload(struct adapter *padapter)
if (cnt > 5)
break;
cnt++;
- msleep(10);
+ usleep_range(10000, 11000);
}
/* check the status of IPS */
@@ -1092,7 +1092,7 @@ void rtw_suspend_common(struct adapter *padapter)
pwrpriv->bInSuspend = true;
while (pwrpriv->bips_processing)
- msleep(1);
+ usleep_range(1000, 2000);
if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))
return;
--
2.55.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-29 5:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29 5:20 [PATCH] staging: rtl8723bs: os_intfs: replace msleep with usleep_range Connor Sample
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox