[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5009396.5p49gfLLAe@avalon>
Date: Fri, 27 Apr 2018 01:16:59 +0300
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Jia-Ju Bai <baijiaju1990@...il.com>
Cc: architt@...eaurora.org, a.hajda@...sung.com, airlied@...ux.ie,
daniel.vetter@...ll.ch, bhumirks@...il.com,
narmstrong@...libre.com, inki.dae@...sung.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpu: drm: bridge: adv7511: Replace mdelay with usleep_range in adv7511_probe
Hi Jia-Ju,
Thank you for the patch.
On Wednesday, 11 April 2018 11:33:42 EEST Jia-Ju Bai wrote:
> adv7511_probe() is never called in atomic context.
> This function is only set as ".probe" in struct i2c_driver.
>
> Despite never getting called from atomic context, adv7511_probe()
> calls mdelay() to busily wait.
> This is not necessary and can be replaced with usleep_range() to
> avoid busy waiting.
>
> This is found by a static analysis tool named DCNS written by myself.
> And I also manually check it.
Nice work ! Is the tool open-source ?
> Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
> ---
> drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index b2431ae..2cf7fa1
> 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -1054,7 +1054,7 @@ static int adv7511_probe(struct i2c_client *i2c, const
> struct i2c_device_id *id) }
>
> if (adv7511->gpio_pd) {
> - mdelay(5);
> + usleep_range(5000, 6000);
> gpiod_set_value_cansleep(adv7511->gpio_pd, 0);
> }
The patch looks good to me.
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists