Received: by 10.192.165.148 with SMTP id m20csp28421imm; Thu, 26 Apr 2018 15:18:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Ng6stXFOInYBv5RrJSz73c1/bYXv0r0QC+tDQv01IjCpQT3o2zzZTb6QNVOhQjV33cDBD X-Received: by 10.99.4.88 with SMTP id 85mr29353080pge.156.1524781085983; Thu, 26 Apr 2018 15:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524781085; cv=none; d=google.com; s=arc-20160816; b=z+ppCGtODlOsTX1qruV7dbcFxRbbZhq9eMYSLdo0LQd98pxFF8K9BeGzZ2zt5zpbIU s0OSt/YkUjU7kAd5JaLVBQOf7LxuLaOv1Kl0NBjq10qVlwU2D1q6WAMOi0XNJ8ZKhEub dIbJcke+r+wrkSAFpoOzbQhCh3l1iSnPMMMyN+3vb5TimjAwnAsmIj/AQb04hxR6yhJ+ /wbPKgG+kKA3sfs9HhZPLF42ij5I94GvwyxoJgdxwe/kYg2n+esRx95UIQ2c8xBfpgKG 5F7XVHfWVr9/uihH/DmMES/jHjnEYYiqlXjo3Zz9jR3ohjRkV29AkjoJWYs5cAP+EfMf h2GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=xzgAjhYpQ0t1wJtxk+SJB8oF/Gnt1e9hjCqDleYDudE=; b=VqnGjQTFjoId8Y1xchWiTLm2sKBfvIWz8Gd/OsMSX1KTfZ8NGFYNVnMpQ4kAZ2PTcF paVh5t1ZKzVv/x7kshZbewAvC5wnjHQTiVAJ3hR+sFytZzIl4W5/jjVjU+pHnS54apgl N2G+05OV3EwmO8c9a7Q0rhFIf92jpmIdwhbVSPox+GmBtF2UKHfG6iz8IeyQVTVGsxUW 0sO/HIN7R1OrxKPcZ3Id5dvvL78ZUDvilt07wRv8ZeaaxlPweEJWvuJ2maZyCDUVU55R JS8Naqaz75LAGXr8kF0Nt+TGUhe08ukb8eWoYsMiok5H++jgaPS2gJHIafIEVe1MMbva DHzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=R9xNIYGO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si18448306plb.558.2018.04.26.15.17.52; Thu, 26 Apr 2018 15:18:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=R9xNIYGO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756811AbeDZWQs (ORCPT + 99 others); Thu, 26 Apr 2018 18:16:48 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:60952 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754760AbeDZWQq (ORCPT ); Thu, 26 Apr 2018 18:16:46 -0400 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7567B3E45; Fri, 27 Apr 2018 00:16:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1524781005; bh=oDIlhXAPRbZvBH/esM3UTpRxXBpVnQdq9x/WJ/M5HUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R9xNIYGOG+YEX0xd5YSWcRgOW5rwD38F4/Ogfwcz2KPc8LYIya+dOGCuFDrd2+gLt laVgbjqA1EMiRpksfPDo6NAyz1WN/bA2Haf4dU3uG+Jel4zi5fTo7aEr6VCdtDOPjk 5oPWQg61x2jqG85KMY4RNiemXcSspXQWqYWx7n+0= From: Laurent Pinchart To: Jia-Ju Bai Cc: architt@codeaurora.org, 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, 27 Apr 2018 01:16:59 +0300 Message-ID: <5009396.5p49gfLLAe@avalon> Organization: Ideas on Board Oy In-Reply-To: <1523435622-4329-1-git-send-email-baijiaju1990@gmail.com> References: <1523435622-4329-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 -- Regards, Laurent Pinchart