Received: by 10.223.176.46 with SMTP id f43csp176259wra; Tue, 23 Jan 2018 18:35:10 -0800 (PST) X-Google-Smtp-Source: AH8x2273Hll2XAwD2J8x7NipCkfY8zDKGWxia/TLc83TWb0+ZLimeF0L9d/37nrrAnN1Et2pvfaJ X-Received: by 2002:a17:902:4906:: with SMTP id u6-v6mr1364890pld.92.1516761310835; Tue, 23 Jan 2018 18:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516761310; cv=none; d=google.com; s=arc-20160816; b=djUTtQNFpnSjS5UZFmXMONY83wm7EJcxkWus6BJrodyzYRyIUETTajLpEfStncl7DS NM6ddgdaXC1jJgfsHsJ9FbIopz+UzBChAhJzfOVTqsMPe3EMnYGRu0OFn2GsfZ/f4l2P eQpXBxrwEyameXaoovm/6y0RtKUqm54eLwgZu8abQBM8enkLyhlgBKiAjeT2rt8ODrd4 DY4gucuS3DkoYBx4ivspEgYkiumxh4UWVMOJW/K166fR2tDNNmd0KxFo5hy7A/Askv/5 xiOT8g12Q4fLjMLeZjg8Aea9f5XuUNYWC9ylIl94RtXJ13VeywyKzDYFFaJAwOzoM5GT qm8Q== 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=M4T17j+2PvauFgnQOSxineGJ7bG2om4h4mSaZ7mgaZ4=; b=BEvsXxphHHTgeiBV8i8k92Z7cywKLFbMFNn6W1UafsKYrDeUj3VYU/b624OHfW/DIt 4d4vvdccZ9deF198owZsTo4+q51p2dVs3BRTqixJxvX9aD2Y5JpYbj2hKKFbhpiwXLef v+cCE1u/h2CEpnTbBsg5CCq8kIKUq8a5rwY3iUHJH5KzWTK2Xp7OfixT1TbydyfNJdNx Lg00Z8AEXjSQpQj09jsmYTfdASSZAQn/DRQWG7hL9OoqE51iru0olv6wljDXg/uZkgDZ mxeTJu999B0M/ab9wRu6HDyTokHMH8Qc9leqvVWSx+3w6fAXiy4lT7on/tiI9ebU6Nhi VGJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o0GZUIwk; 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=NONE 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 i3-v6si5373065plt.369.2018.01.23.18.34.57; Tue, 23 Jan 2018 18:35:10 -0800 (PST) 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=o0GZUIwk; 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=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752383AbeAXCd7 (ORCPT + 99 others); Tue, 23 Jan 2018 21:33:59 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:46006 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbeAXCd5 (ORCPT ); Tue, 23 Jan 2018 21:33:57 -0500 Received: by mail-pf0-f194.google.com with SMTP id a88so1890443pfe.12 for ; Tue, 23 Jan 2018 18:33:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=M4T17j+2PvauFgnQOSxineGJ7bG2om4h4mSaZ7mgaZ4=; b=o0GZUIwktojWAgihvwP2mssTYjKI7N7vmM9AgQuArvXcBbCpbIjrUBrRW+PDLEZtkF r84/4MAzCH3iclW4TaWUFUpLhf80qtVEP7lYptJDYDFEZa1nNUKT3i+6VBth8h7T4p4e fPWY0NBkGmuRIlxYO5NMxwhSNJEa78iZGk9rIxylfBwNFlgzDxmDZA59b3SRS0jYzUZg cuhtRmq+RtV/iYDHpP7bxLONWe8PpXSbGhj11oDNIPelxXkBrRVidQj/iEPLnMsf5q/w Ua0NEMRpyZqgqpzdyLAPAYtKsS6v9M/vVao4m5H1ewIJOdo0edhas4Lk0mBjqTV2aSRe VcLA== 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=M4T17j+2PvauFgnQOSxineGJ7bG2om4h4mSaZ7mgaZ4=; b=DgJOP9kjSLpdbC2rtbcd+DFg1R3Gk6thDJXBaQKatKhHUuK6msnzM9HhxHXWp66Tsj 6oREk2k7ybjHYhWRRSg7QZAXJpKuOkb+i7bN9iabI9WtUlTw1hnrtcqreGNkk9dcmqC0 k4dz1/PBvkTP7uX4p7dE7qpVYJ5yCWTWMzN4PjJcRBsYIxKCScb4FvqzDAf/TFRMZcWI BS7b1UPnh6yQMs1CCmBGefP9BljYX1/wiPUcrMxdKwfRgU98NaXMelTGgVhjP40GCzcZ 4EWr9LR1I/VsEs7H740jR0rh3WpHisIV5V08lR/p08jIH5V3C2gwLkieDNwUSsU9gwbw yQjw== X-Gm-Message-State: AKwxytdTeIOsAnCxsK9DRRcYOrOZfWzZwn5Zr6nvN5AjaMSrM05dwt6T kv+/6Ss6F4zlblQV/PXeaPY= X-Received: by 10.98.189.8 with SMTP id a8mr11563426pff.125.1516761237429; Tue, 23 Jan 2018 18:33:57 -0800 (PST) Received: from bai-oslab.tsinghua.edu.cn ([2402:f000:1:4413:e16d:1588:961d:f546]) by smtp.gmail.com with ESMTPSA id d20sm7711661pfe.166.2018.01.23.18.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jan 2018 18:33:56 -0800 (PST) From: Jia-Ju Bai To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, paulo.r.zanoni@intel.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, lukas@wunner.de Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] kernel: x86: early-quirks: Replace mdelay with usleep_range in apple_airport_reset Date: Wed, 24 Jan 2018 10:38:22 +0800 Message-Id: <1516761502-18360-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function apple_airport_reset is not called in atomic context. Thus mdelay can be replaced with usleep_range, to avoid busy wait. This is reported by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- arch/x86/kernel/early-quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 1e82f78..559e81a 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -604,7 +604,7 @@ static void __init apple_airport_reset(int bus, int slot, int func) if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0) { pmcsr &= ~PCI_PM_CTRL_STATE_MASK; write_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL, pmcsr); - mdelay(10); + usleep_range(10000, 11000); pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL); if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0) { -- 1.7.9.5