* [PATCH] staging: rtl8723bs: os_intfs: replace msleep with usleep_range
@ 2026-07-29 5:20 Connor Sample
2026-07-30 7:37 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [PATCH] staging: rtl8723bs: os_intfs: replace msleep with usleep_range
2026-07-29 5:20 [PATCH] staging: rtl8723bs: os_intfs: replace msleep with usleep_range Connor Sample
@ 2026-07-30 7:37 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-30 7:37 UTC (permalink / raw)
To: Connor Sample
Cc: linux-staging, Ethan Tidmore, Nikolay Kulikov, Dan Carpenter,
Luka Gejak, Khushal Chitturi, Hungyu Lin, Samasth Norway Ananda,
Adrish Bora, Shyam Sunder Reddy Padira
On Wed, Jul 29, 2026 at 01:20:38AM -0400, Connor Sample wrote:
> 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.
Please see the many places in the mailing list archives where we have
rejected this same patch :)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-30 7:38 UTC | newest]
Thread overview: 2+ messages (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
2026-07-30 7:37 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.