From: Marco Lu <mcl7d9@gmail.com>
To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: Marco Lu <mcl7d9@outlook.com>
Subject: [PATCH] staging: rtl8723bs: replace msleep with usleep_range in _rtw_free_evt_priv
Date: Wed, 1 Apr 2026 11:42:54 +0800 [thread overview]
Message-ID: <20260401034301.31014-1-mcl7d9@outlook.com> (raw)
The msleep(10) call is an imprecise busy-wait function in
core/rtw_cmd.c/_rtw_free_evt_priv due to timer jitter.
Replace it with usleep_range(10000, 11000)
to save CPU cycles to provide more precise timing.
Signed-off-by: Marco Lu <mcl7d9@outlook.com>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index abb84f8ae..14778c22e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -214,8 +214,7 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
{
_cancel_workitem_sync(&pevtpriv->c2h_wk);
while (pevtpriv->c2h_wk_alive)
- msleep(10);
-
+ usleep_range(10000, 11000);
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
--
2.53.0
next reply other threads:[~2026-04-01 3:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 3:42 Marco Lu [this message]
2026-04-01 4:13 ` [PATCH] staging: rtl8723bs: replace msleep with usleep_range in _rtw_free_evt_priv Ethan Tidmore
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=20260401034301.31014-1-mcl7d9@outlook.com \
--to=mcl7d9@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mcl7d9@outlook.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