From: Sakari Ailus <sakari.ailus@iki.fi>
To: Ramon Watson Vilar <watsonvilar@gmail.com>
Cc: hansg@kernel.org, mchehab@kernel.org, gregkh@linuxfoundation.org,
sakari.ailus@linux.intel.com, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: media: atomisp: use usleep_range instead of msleep for short delays
Date: Thu, 16 Apr 2026 12:46:10 +0300 [thread overview]
Message-ID: <aeCv4m9eW6E-YE1j@valkosipuli.retiisi.eu> (raw)
In-Reply-To: <20260415190005.114900-1-watsonvilar@gmail.com>
Hi Ramon,
On Wed, Apr 15, 2026 at 04:00:05PM -0300, Ramon Watson Vilar wrote:
> The msleep() function is not precise for delays shorter than 20ms and
> can sleep for significantly longer than requested. Replacing it with
> usleep_range() improves accuracy and is the recommended practice
> according to documentation.
>
> Signed-off-by: Ramon Watson Vilar <watsonvilar@gmail.com>
> ---
> drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> index d3414312e1de..e0b0f09a5c26 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> @@ -433,7 +433,7 @@ static int power_up(struct v4l2_subdev *sd)
> goto fail_power;
> }
>
> - msleep(5);
> + usleep_range(5000, 10000);
A similar patch <20260319204242.2076191-1-abhai@protonmail.com> has already
been submitted.
> return 0;
>
> fail_clk:
--
Regards,
Sakari Ailus
prev parent reply other threads:[~2026-04-16 9:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 19:00 [PATCH v2] staging: media: atomisp: use usleep_range instead of msleep for short delays Ramon Watson Vilar
2026-04-16 9:46 ` Sakari Ailus [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=aeCv4m9eW6E-YE1j@valkosipuli.retiisi.eu \
--to=sakari.ailus@iki.fi \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=watsonvilar@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