Received: by 10.192.165.156 with SMTP id m28csp448296imm; Wed, 11 Apr 2018 01:37:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/4YLD1wrVHu9xx+iHm81UCXFkeYXDz5CtJ+2HJOK1LDCbbn/6CMUa9Ud7o/xe9CJWphNN4 X-Received: by 10.98.147.135 with SMTP id r7mr3249869pfk.31.1523435844584; Wed, 11 Apr 2018 01:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523435844; cv=none; d=google.com; s=arc-20160816; b=u90/o2KIOUx2YFNGllnTsE08roVejzQWGCejaUbb5IC7kckx1sYcImPMb9OhOxkDxq HhVNK81b4xVVdRyiH0wcqSWgR7ZSEjdJV+xvy/SEMIOSWNcDDc+I83nxzuuq5fIJd6My se/ssi+rJuUH7zUQMn11voqNdduAsclLxzc9ADnywkCovL9iPUfF4sWrHl83bIuXkP/N HJUgde092szr5kMw9OumXCm6V0R1y6pv5bZDIsH6n8aOSR/SMu44RIbLWODMPe78qor4 CG1TDGUEyFgoorkz2aImBNJbDGaE97qqpVGtas4lkQ9XrOkPyTHmk2ZvIWxlz3PWnuU5 Wp5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=wLlVJRS+Ijlw1Yq7udU5aP7Rn3QKbhq9dIhW5scfsXI=; b=JTItF1QyBqvhmzvJxwoRbDfeNZVF3r9eKnDuKk2yUBLG0f5KGTvYe8k9S424tf1UP3 3i2w3M4mAAuPpuX+nAi3y8Olg3FdvjnaoqmzBAme4fZDVDUn87VW8aOAhlao0BzZMpzd lLYWsBS+ynirynHQdbb/XEZpI6+I7LV31DxDpVF/Yfn+407KHqynbxhl3r7b2h5ORrCn f8IEq9Zl5/WpaY8qD4gFCWbPZhkFhEacSjkbNYebMHfpZ59G1fJxnZP4veMuobnJzW3d 98zfhp6YiF0sgbV+OV8Pp0F53ir6+RTP9La5n91RIppvo3Jnm4qa/v0RToAEYAGrRcCJ PSZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20120113 header.b=0npMSh7B; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15-v6si620603pli.163.2018.04.11.01.36.47; Wed, 11 Apr 2018 01:37:24 -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 header.i=@gmail.com header.s=20120113 header.b=0npMSh7B; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752253AbeDKId6 (ORCPT + 99 others); Wed, 11 Apr 2018 04:33:58 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:35134 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbeDKId4 (ORCPT ); Wed, 11 Apr 2018 04:33:56 -0400 Received: by mail-it0-f67.google.com with SMTP id q85-v6so1680972itc.0 for ; Wed, 11 Apr 2018 01:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wLlVJRS+Ijlw1Yq7udU5aP7Rn3QKbhq9dIhW5scfsXI=; b=0npMSh7BNtDbih37f0vt1Qk59Vvaeq7CbVGeZwVWTrBOC7f27bACIN2sN0hmYtOQ8P 2cml3EPMhP1d/gvwnyPJ8zjpx6rlbP7wG9ccwDXhwAElEfyxVGBRVza+VEv51wkomxEH NLvMs4EMUNO3+LhLg5puIKpbgprQhTG04lYT2kTxo8azxD/09MaoaI/rQxsOTa9RFFRY lWSqMFy9fryFMzGXLBBIHzFlLvtu8fTReTB6I+lbnxrQyr1kDhk1V6M2CIgYkucXHAYf DrFJ/vy0k6qV0u9wPuY81j3SkMkW2yN8CD8UIehsQN3E6DoinWSnwchqnvjzb3gkGm6D dHHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wLlVJRS+Ijlw1Yq7udU5aP7Rn3QKbhq9dIhW5scfsXI=; b=lC+lqHNkSJqfMgH2QMbbIdHaSPZZ2+HP0YaSaRSW9+7YW5wlt/DwpH5mDxvY6ZXBNO s2FrZvExetCfZvaPQxARv5rcgc8SO4QmLhFICABP4LqIGv1KXBO8sq9C1TnDmncsRIi8 t5m+GBDc3nUZct+KWGCdtojHl3WKsauPC5eLi4GcnJP+WViz9VaQLUrhf67OIKzQEf9L XdGUTKyPHMUJUN6LT20fJ4aTXh4ZL2k5m19CrjGHuUzvkEA0Fg5G1/stvQHlcN7PBhgE wxpf1oMTczO0qTKJUGz3BCvoW+XBmLf8Kw5Jp4jHZJ1gddMdvWr7EPCPy5BIBi7b7dDK 0O/Q== X-Gm-Message-State: ALQs6tBY9RJRHF4iTl64CJrIVFJrTWAt6iHaoTAhq8wC/jCRnRqv9cSy Tr1WqrFBVBtX/fT4E2E3s4A= X-Received: by 2002:a24:ee47:: with SMTP id b68-v6mr3092610iti.0.1523435635529; Wed, 11 Apr 2018 01:33:55 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id h74sm289565ioh.35.2018.04.11.01.33.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Apr 2018 01:33:54 -0700 (PDT) From: Jia-Ju Bai To: architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, airlied@linux.ie, daniel.vetter@ffwll.ch, bhumirks@gmail.com, narmstrong@baylibre.com, inki.dae@samsung.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] gpu: drm: bridge: adv7511: Replace mdelay with usleep_range in adv7511_probe Date: Wed, 11 Apr 2018 16:33:42 +0800 Message-Id: <1523435622-4329-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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); } -- 1.9.1