public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Rodrigo Filipe Faria <me@rodrigofilipefaria.org>
Cc: gregkh@linuxfoundation.org, s9430939@naver.com,
	architanant5@gmail.com, ignacio.pena87@gmail.com,
	strnad.jj@gmail.com, bryant.boatright@proton.me, kees@kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Rodrigo Filipe Faria <rodrigofaria@student.dei.uc.pt>
Subject: Re: [PATCH] staging: rtl8723bs: change msleep to usleep_range
Date: Wed, 25 Feb 2026 17:55:29 +0200	[thread overview]
Message-ID: <aZ8bcbThvwYNIs7Y@smile.fi.intel.com> (raw)
In-Reply-To: <20260225135723.60791-1-rodrigofaria@student.dei.uc.pt>

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



      parent reply	other threads:[~2026-02-25 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=aZ8bcbThvwYNIs7Y@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=architanant5@gmail.com \
    --cc=bryant.boatright@proton.me \
    --cc=gregkh@linuxfoundation.org \
    --cc=ignacio.pena87@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=me@rodrigofilipefaria.org \
    --cc=rodrigofaria@student.dei.uc.pt \
    --cc=s9430939@naver.com \
    --cc=strnad.jj@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