[PATCH v2] staging: rtl8723bs: replace msleep(10) with usleep_range()

Yash Mehla posted 1 patch 1 month, 1 week ago
drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH v2] staging: rtl8723bs: replace msleep(10) with usleep_range()
Posted by Yash Mehla 1 month, 1 week ago
msleep() should not be used for delays shorter than 20 ms.
Replace msleep(10) with usleep_range(10000, 20000) and add
<linux/delay.h> for the declaration.

Signed-off-by: Yash Mehla <yashmehla688@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index abb84f8ae..93a9e9672 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -5,6 +5,7 @@
  *
  ******************************************************************************/
 #include <drv_types.h>
+#include <linux/delay.h>
 #include <hal_btcoex.h>
 #include <linux/jiffies.h>
 #include <linux/align.h>
@@ -214,7 +215,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, 20000);
 
 	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
 		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
-- 
2.53.0
Re: [PATCH v2] staging: rtl8723bs: replace msleep(10) with usleep_range()
Posted by Ethan Tidmore 1 month, 1 week ago
On Tue Mar 3, 2026 at 2:45 AM CST, Yash Mehla wrote:
> msleep() should not be used for delays shorter than 20 ms.
> Replace msleep(10) with usleep_range(10000, 20000) and add
> <linux/delay.h> for the declaration.
>
> Signed-off-by: Yash Mehla <yashmehla688@gmail.com>
> ---

This has already came up before and Greg decided to drop it. [1]

Thanks,

ET

[1] https://lore.kernel.org/linux-staging/20260214173139.49094-1-ofekalm100@gmail.com/