Re: [PATCH v2] staging: media: atomisp: use usleep_range instead of msleep for short delays
From: Sakari Ailus
Date: Thu Apr 16 2026 - 05:51:15 EST
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@xxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxx> has already
been submitted.
> return 0;
>
> fail_clk:
--
Regards,
Sakari Ailus