From: Gustavo Arantes <dev.gustavoa@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Gustavo Arantes <dev.gustavoa@gmail.com>
Subject: [PATCH] staging: rtl8723bs: replace msleep with usleep_range in rtw_dev_unload
Date: Sun, 8 Mar 2026 18:56:19 -0300 [thread overview]
Message-ID: <20260308215619.608685-1-dev.gustavoa@gmail.com> (raw)
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.
Signed-off-by: Gustavo Arantes <dev.gustavoa@gmail.com>
---
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index f2d64b05debb..b5fac9ebc3c7 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -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 */
--
2.53.0
next reply other threads:[~2026-03-08 21:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 21:56 Gustavo Arantes [this message]
2026-03-09 13:37 ` [PATCH] staging: rtl8723bs: replace msleep with usleep_range in rtw_dev_unload Bryant Boatright
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=20260308215619.608685-1-dev.gustavoa@gmail.com \
--to=dev.gustavoa@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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 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.