Received: by 10.192.165.156 with SMTP id m28csp240063imm; Tue, 10 Apr 2018 20:43:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx499LTVqYjtcBCweBbfXzlLWNjZvJCymxj5V+iPNnowxwFfUYWSHbQMb50qZ6OU++Nw0sUA2 X-Received: by 10.98.96.195 with SMTP id u186mr2529610pfb.81.1523418192474; Tue, 10 Apr 2018 20:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523418192; cv=none; d=google.com; s=arc-20160816; b=nSZMfcv0GIiVi993mkzOTF/IoMqJ8O5ue4P3nskbkdSJv4Ebkjv3UWYH9gPy18XWI3 QXGAUxR3XxUjZ3UuDPEbmTpP8VkJ4JmX6y5xPDEKtY1kApbBYaJ563fcX7xRwJIs897B 6lrheyaQtNF8+sIO/T9ZT0VfvuJDwiGCbnZ85dGf2Ks5HGvz8/LQvgF2vqKTSkADyyzW pLjKJmw5Pnmb9jTt3JxFv083lUAm6s9OMiYp73ZI3oqVPy1tQYngpThAv1PjVU1RVxIi SC9CC0oBWoOAcgXDIQJX49pEyliJ4cRxHdZ+45xoyw7Fx941QepPmAx6jYY0FiDaJCQH 7tCQ== 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=GC9drIeTnStbM+mqADMuVIWXulXRLf4FrnezzoMROdI=; b=FHhwTM4GShJN9Xl8lBx1NNWjlN6pIxflBgkLwgBeddWdpJ2/r+QSgHdSef/QzHcjET 2B64106a9tNOhL1OXtq+OrMdg4P8hoBgJ9NvbXClc29JOCuKI0tSjbvEAZbzMNJvQD2r yRwQAyD5PlGIzamEZ1sOMrBa4PDny0ycxRNKv4dXrtWi5K6PDiYYfT8hnQY6jfwg513S B3xK71MrR60HBKX+sLQDzxv+nkdT+utG2OVv5nEcIYbVknlp8iI7LOK7nQLMNBY0Hmkh 2z2IpZRNjg9t855f8PK/wR4zt5lLez628bMYVSyxyToUGgF21vhmQXpHt6ggkI7+uOo6 wyUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lbedUH/X; 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 v8si174904pff.125.2018.04.10.20.42.36; Tue, 10 Apr 2018 20:43:12 -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=lbedUH/X; 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 S1752656AbeDKDdt (ORCPT + 99 others); Tue, 10 Apr 2018 23:33:49 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:45497 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbeDKDdo (ORCPT ); Tue, 10 Apr 2018 23:33:44 -0400 Received: by mail-pl0-f68.google.com with SMTP id e22-v6so349192plj.12; Tue, 10 Apr 2018 20:33:44 -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=GC9drIeTnStbM+mqADMuVIWXulXRLf4FrnezzoMROdI=; b=lbedUH/XmPuer13bv0J1r5Y5njrEEohoAUXw2HY9AAi1MkmlYw2Fo0aTBUk8vQqlCf C1NgxO3TCUm5ysPY78TmvJqJwvgZBdJ70Qca8vg2kd2gbCPwsZ2XDqJ1MAePiUmrGbEB M/a1FlGW94NIwxvHudldni6FUh2fbV6zTxv1L7yRz6uTpUtBis0v9BJx3+GQveZ+0W2V p2kKQJioLXoZ3CNFGJemdJ3ZF7n8NyHPf7maZQ2PpO8MA7zuxX05y2iYd1Ssv3EmJXXB jmmrt9p+HZ9cpEvPdvV8RFVgzp8TKN8rrVj1qysTEsM+J2IWwrO/NKTuUgF6ToFRqC6/ nRdQ== 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=GC9drIeTnStbM+mqADMuVIWXulXRLf4FrnezzoMROdI=; b=o5fqgKr/NhxlrdZTrHdhO0KO7oPWC0jlq+QxU5tj/G2xuWIN9tGonUl1H8n0fTlrwH funywb3iRyqfiGhbQcKtkeoKro8iDKhFSo1CRdNVGnACw3Vj6CLu+Q88Fw1CgXQt5/wv 2nvia1Qi5itBGuEidgiWAubyJjM+Jh2fUhDRHspgp1bgpz+V4BADYK0F76Hco7wOWlI7 iHzUXd6k95kdjwrcjMjwdUjSgy+RXfB8IOas5Au5o3VMPcxXFgNHGlYqoZlthBhl3RYB f/yxEWAC6a/GmUu5byjqjNk6Z7AP6IOZ1VdefwaOVjsyZWl4Vq8KI31j91vXBzIFPzgH Iadw== X-Gm-Message-State: ALQs6tBIVlgoDCBNclYSUO7ays+WKE/HwO7/3y/cbKJHAjR2N4OElbAO LOhqf5BiRAzLP/9Octc0qzg= X-Received: by 2002:a17:902:1744:: with SMTP id i62-v6mr3248971pli.62.1523417624421; Tue, 10 Apr 2018 20:33:44 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id a75sm322513pfg.135.2018.04.10.20.33.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 20:33:43 -0700 (PDT) From: Jia-Ju Bai To: isdn@linux-pingi.de, davem@davemloft.net, johannes.berg@intel.com, arvind.yadav.cs@gmail.com, stephen@networkplumber.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 1/2] isdn: hisax_fcpcipnp: Replace mdelay with usleep_range in fcpci_init Date: Wed, 11 Apr 2018 11:33:37 +0800 Message-Id: <1523417617-3249-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 fcpci_init() is never called in atomic context. The call chain ending up at fcpci_init() is: [1] fcpci_init() <- fcpcipnp_setup() <- fcpnp_probe() fcpnp_probe() is set as ".probe" in struct pnp_driver. This function is not called in atomic context. Despite never getting called from atomic context, fcpci_init() 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/isdn/hisax/hisax_fcpcipnp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c index e4f7573..4789c9d 100644 --- a/drivers/isdn/hisax/hisax_fcpcipnp.c +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c @@ -706,7 +706,7 @@ static inline void fcpci_init(struct fritz_adapter *adapter) outb(AVM_STATUS1_ENA_IOM | adapter->irq, adapter->io + AVM_STATUS1); - mdelay(10); + usleep_range(10000, 11000); } // ---------------------------------------------------------------------- -- 1.9.1