mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: a.hajda@samsung.com, airlied@linux.ie, daniel.vetter@ffwll.ch,
	bhumirks@gmail.com, narmstrong@baylibre.com,
	inki.dae@samsung.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpu: drm: bridge: adv7511: Replace mdelay with usleep_range in adv7511_probe
Date: Fri, 4 May 2018 11:38:46 +0530	[thread overview]
Message-ID: <4cc08136-b05f-89d9-6e6f-dcd12ebc86d3@codeaurora.org> (raw)
In-Reply-To: <5009396.5p49gfLLAe@avalon>



On Friday 27 April 2018 03:46 AM, Laurent Pinchart wrote:
> 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@gmail.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@ideasonboard.com>

queued to drm-misc-next

Thanks,
Archit

      reply	other threads:[~2018-05-04  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11  8:33 Jia-Ju Bai
2018-04-26 22:16 ` Laurent Pinchart
2018-05-04  6:08   ` Archit Taneja [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=4cc08136-b05f-89d9-6e6f-dcd12ebc86d3@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=baijiaju1990@gmail.com \
    --cc=bhumirks@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.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

Powered by JetHome