Linux kernel staging patches
 help / color / mirror / Atom feed
From: Connor Sample <tabulatejarl8@gmail.com>
To: linux-staging@lists.linux.dev
Cc: Connor Sample <tabulatejarl8@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ethan Tidmore <ethantidmore06@gmail.com>,
	Nikolay Kulikov <nikolayof23@gmail.com>,
	Dan Carpenter <error27@gmail.com>,
	Luka Gejak <luka.gejak@linux.dev>,
	Khushal Chitturi <khushalchitturi@gmail.com>,
	Hungyu Lin <dennylin0707@gmail.com>,
	Samasth Norway Ananda <samasth.norway.ananda@oracle.com>,
	Adrish Bora <adrishbora@gmail.com>,
	Shyam Sunder Reddy Padira <shyamsunderreddypadira@gmail.com>
Subject: [PATCH] staging: rtl8723bs: os_intfs: replace msleep with usleep_range
Date: Wed, 29 Jul 2026 01:20:38 -0400	[thread overview]
Message-ID: <20260729052040.249972-1-tabulatejarl8@gmail.com> (raw)

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


                 reply	other threads:[~2026-07-29  5:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260729052040.249972-1-tabulatejarl8@gmail.com \
    --to=tabulatejarl8@gmail.com \
    --cc=adrishbora@gmail.com \
    --cc=dennylin0707@gmail.com \
    --cc=error27@gmail.com \
    --cc=ethantidmore06@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khushalchitturi@gmail.com \
    --cc=linux-staging@lists.linux.dev \
    --cc=luka.gejak@linux.dev \
    --cc=nikolayof23@gmail.com \
    --cc=samasth.norway.ananda@oracle.com \
    --cc=shyamsunderreddypadira@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox