From patchwork Wed Apr 11 08:33:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10335361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E7A8260365 for ; Wed, 11 Apr 2018 11:56:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D19A2288BC for ; Wed, 11 Apr 2018 11:56:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C58FC288C5; Wed, 11 Apr 2018 11:56:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F814288BC for ; Wed, 11 Apr 2018 11:56:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FAF56E610; Wed, 11 Apr 2018 11:56:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 242E56E0DF for ; Wed, 11 Apr 2018 08:33:56 +0000 (UTC) Received: by mail-it0-x244.google.com with SMTP id 71-v6so1673140ith.2 for ; Wed, 11 Apr 2018 01:33:56 -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=OYrJ5S5Ey7LkNNS7DUnilmxQf751M87aKVBRQRU67cxI1ND6h4cWfF7Wm8/j5sNPYw iQzJ6+g5n6IscLsy/Wz4KGnykwpWSNhA4avDsT8flyEiTgPa9ES8GYjjTVqi/X66+sPh SC6HCJlCzKQvTY8SqJnT/djYA/AHE4ohCu9/r26g78wlZfR1cTLaJyc5CLSrJ6ucRJYJ Od3upk6xUdiuJshntd7iMxOs6wn6jRZlvq8sW/3T6+35BJGZt2t1fBW6uAbODskWMY/w XBVmJXWKD9ql+pGGN9lYk1qqx4WWXSVKc0WgDODKlJ520h5bRruaK7F/OcN94w2Ax3FV Yogw== X-Gm-Message-State: ALQs6tAsASY5KGqx12p8Q4XShssxQEFXYwglq2dgVgQ5PkoN0fbndMoD 30jBWbvVrOinlboXhPgeAF8= X-Google-Smtp-Source: AIpwx4//zpnzrddpE2RHTf688CFD/OiQ5DgtVQY0exfImZntl3ufrOPVXutmQlBUTCruEK5fsEag2A== 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 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 X-Mailman-Approved-At: Wed, 11 Apr 2018 11:56:52 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jia-Ju Bai , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Laurent Pinchart --- 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); }