public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: change msleep to usleep_range
@ 2026-02-25 13:57 Rodrigo Filipe Faria
  2026-02-25 14:15 ` Greg KH
  2026-02-25 15:55 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Rodrigo Filipe Faria @ 2026-02-25 13:57 UTC (permalink / raw)
  To: gregkh
  Cc: s9430939, architanant5, andriy.shevchenko, ignacio.pena87,
	strnad.jj, bryant.boatright, kees, linux-staging, linux-kernel,
	Rodrigo Filipe Faria

checkpatch.pl gave "WARNING: msleep < 20ms can sleep for up to 20ms".

Kernel documentation says that usleep_range() must be used for
delays of 10us to 20ms.
msleep() is inaccurate with the values used.

Signed-off-by: Rodrigo Filipe Faria <rodrigofaria@student.dei.uc.pt>
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index abb84f8aecbe..f6293f049c75 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -214,7 +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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: rtl8723bs: change msleep to usleep_range
  2026-02-25 13:57 [PATCH] staging: rtl8723bs: change msleep to usleep_range Rodrigo Filipe Faria
@ 2026-02-25 14:15 ` Greg KH
  2026-02-25 15:55 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-02-25 14:15 UTC (permalink / raw)
  To: Rodrigo Filipe Faria
  Cc: s9430939, architanant5, andriy.shevchenko, ignacio.pena87,
	strnad.jj, bryant.boatright, kees, linux-staging, linux-kernel,
	Rodrigo Filipe Faria

On Wed, Feb 25, 2026 at 01:57:23PM +0000, Rodrigo Filipe Faria wrote:
> checkpatch.pl gave "WARNING: msleep < 20ms can sleep for up to 20ms".
> 
> Kernel documentation says that usleep_range() must be used for
> delays of 10us to 20ms.
> msleep() is inaccurate with the values used.
> 
> Signed-off-by: Rodrigo Filipe Faria <rodrigofaria@student.dei.uc.pt>
> ---
>  drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> index abb84f8aecbe..f6293f049c75 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> @@ -214,7 +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
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You sent a patch that has been sent multiple times in the past few
  days, and is identical to ones that has been recently rejected.
  Please always look at the mailing list traffic to determine if you are
  duplicating other people's work.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: rtl8723bs: change msleep to usleep_range
  2026-02-25 13:57 [PATCH] staging: rtl8723bs: change msleep to usleep_range Rodrigo Filipe Faria
  2026-02-25 14:15 ` Greg KH
@ 2026-02-25 15:55 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-02-25 15:55 UTC (permalink / raw)
  To: Rodrigo Filipe Faria
  Cc: gregkh, s9430939, architanant5, ignacio.pena87, strnad.jj,
	bryant.boatright, kees, linux-staging, linux-kernel,
	Rodrigo Filipe Faria

On Wed, Feb 25, 2026 at 01:57:23PM +0000, Rodrigo Filipe Faria wrote:
> checkpatch.pl gave "WARNING: msleep < 20ms can sleep for up to 20ms".
> 
> Kernel documentation says that usleep_range() must be used for
> delays of 10us to 20ms.
> msleep() is inaccurate with the values used.

No, the modern API is fsleep().

...

> @@ -214,7 +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);

I saw something similar in the past.
https://lore.kernel.org/linux-staging/20260214173139.49094-1-ofekalm100@gmail.com/

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-25 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 13:57 [PATCH] staging: rtl8723bs: change msleep to usleep_range Rodrigo Filipe Faria
2026-02-25 14:15 ` Greg KH
2026-02-25 15:55 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox