Received: by 10.213.65.68 with SMTP id h4csp3567071imn; Tue, 10 Apr 2018 00:40:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/LMbPl//uGrTq5LHqeGlNbIzmHQQwK533p9JPe8fh6ylgTxWLF7HJNRFAdOv3+eYfZwGAH X-Received: by 10.99.54.75 with SMTP id d72mr27113223pga.96.1523346030779; Tue, 10 Apr 2018 00:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523346030; cv=none; d=google.com; s=arc-20160816; b=dQmCDAfBnI0JtCzAfmSdewgx/OPXI5AW8+Z8GEqCNpypMt06TXURdwHooWykMEIqB7 DHUR61CwxUe5+I0I82mbM1v0fjm4B84dI9JEyxudhyX8oHAX5iWPtUDQgUFXgKk2KW4Y 23wC0wgGkjVZSjySDnF76eZYM+iew2f1K7pRy454Xu9sPwRqGyfdnXfjsMi0sVuNe2a+ zPLFxfWFYLQBnaip4mTLtht2xa5F7gYUDOwmfNhpk1abKUmQTPrateVujfZTDXzbm1qE 4+qnlaSnTdL3ougSqxiKrEbJZRC78RIFEekrNIHvkZ59tYNrMgcsTxOeV3Memu4MjlEl wRGA== 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=HBdmxrGkIn3d4tNJRd5H/uZ3HLQbYdE4QGjok7B3Lfg=; b=Wi5EQeFLKHnNqQvs0xui6b4xwnQb+8RZyByM+Q6mGCRzjgx2eWrXERlbSkrSo1TvUU wFYjraRKoq0CNizi3OXl/LyTq2H9Ts586KLfk4Wh+3fso9wpptSJNPxrUrpcDHc7KDPy 8wNz/TwgACZftouY8L/X+FV/r1D+JJQQLu6B+luqy21m8vEASZNutdw7hu37UQEcQYTj 9nIGXWTKRq8rD6D/obVUcbGFZ+h78IsfqcMgW3W+3T154vC+B+m2nkGrqjsJEiarr3RY VGzhoBpZSc35VI1MROAPGTOz4mPe1ID9t7tqHF4drEzwd+Tng5lpoGuPwA79ScLSZwuA Y/zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OM606hmR; 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 p1si1633091pfi.355.2018.04.10.00.39.53; Tue, 10 Apr 2018 00:40:30 -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=20161025 header.b=OM606hmR; 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 S1752333AbeDJHgv (ORCPT + 99 others); Tue, 10 Apr 2018 03:36:51 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:45362 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbeDJHgt (ORCPT ); Tue, 10 Apr 2018 03:36:49 -0400 Received: by mail-pl0-f66.google.com with SMTP id e22-v6so5147843plj.12; Tue, 10 Apr 2018 00:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=HBdmxrGkIn3d4tNJRd5H/uZ3HLQbYdE4QGjok7B3Lfg=; b=OM606hmRdDwXlqesuPYDo3URNU1lE0Xes4cFXLGTnStkfxVraUsFmjhG9Piwk61lkA IZ5A2MHUC8Q9rkVZ/e2ifPax8uny5iZ+2ZSiidxWnqwdVkgOBZITTllVag45i994i7z/ dqzbFM8X5Om7scBalrLYpzMxCIGh7gKWPKSApP5UQFTQYSlbb3jxzIs4nwzf7TRVdGAA FbZPIOOsH7qEsPhJ2aGwsbrKkmvr5oIX7znYWiVP2qtrGVkc7Xrt7Nr+eU4uUpPYUA6q 5PUFL7DsGNL8eKRzoKF+I5j3pA3QtrtQulQ9XgSiDiEGBo3+INerr/A0BesLiF3cIAyd WfQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HBdmxrGkIn3d4tNJRd5H/uZ3HLQbYdE4QGjok7B3Lfg=; b=NkYCiESSJIAOygb62/vaN6HL5VcS6On6UeHlaYtcPSfDN767qtfyOtT7UjLOoZo4z0 4lnG/UeDhNV9j4SulPr9oDzf8+D6hcl5gT2P6ANEQYnDEtY/6n8HptU9ciyrcx9L5vb6 Ei7FMdrHFaiKDfGVVe6iKfvuUFpuXM880e3+fOBp6qVVcmBidIpOdePY0X/3iIZeIJ0z Arr4TyV6RfSSIDkOelVkOFIyIDEc1b47mkWEBGHVxomEIccT3pZdQSDOsqklEzGILpTa wgpUvNzqoQHY/Whs70f/1ODgbX/KxDefkI/hhLRzhFLvQggXenpEeKF6p4spHl1EDQ8h DLGA== X-Gm-Message-State: ALQs6tDCzW52DGkDqsrAe9wAVPdEnfD8M1kKDKeZ9eF2HsCOIHe2ksPk l4qx+dXqSBE/O9JySy1bHx8= X-Received: by 2002:a17:902:8bc6:: with SMTP id r6-v6mr4520639plo.66.1523345809136; Tue, 10 Apr 2018 00:36:49 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:8dc7:7954:4991:f324]) by smtp.gmail.com with ESMTPSA id 67sm5071040pfp.122.2018.04.10.00.36.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 00:36:48 -0700 (PDT) From: Jia-Ju Bai To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 1/2] usb: isp1760: Replace mdelay with msleep in isp1760_init_core Date: Tue, 10 Apr 2018 15:36:40 +0800 Message-Id: <1523345800-29129-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 isp1760_init_core() is never called in atomic context. The call chains ending up at isp1760_init_core() are: [1] isp1760_init_core() <- isp1760_register() <- isp1760_plat_probe() [2] isp1760_init_core() <- isp1760_register() <- isp1761_pci_probe() isp1760_plat_probe() is set as ".probe" in struct platform_driver. isp1761_pci_probe() is set as ".probe" in struct pci_driver. These functions are not called in atomic context. Despite never getting called from atomic context, isp1761_pci_probe() calls mdelay() to busily wait. This is not necessary and can be replaced with msleep() 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/usb/isp1760/isp1760-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c index bfa402c..259c3eb 100644 --- a/drivers/usb/isp1760/isp1760-core.c +++ b/drivers/usb/isp1760/isp1760-core.c @@ -34,7 +34,7 @@ static void isp1760_init_core(struct isp1760_device *isp) /* Low-level chip reset */ if (isp->rst_gpio) { gpiod_set_value_cansleep(isp->rst_gpio, 1); - mdelay(50); + msleep(50); gpiod_set_value_cansleep(isp->rst_gpio, 0); } -- 1.9.1