From patchwork Wed Mar 28 13:47:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 132522 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp496189ljb; Wed, 28 Mar 2018 06:47:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+8BAyQpORov+i/S+jS8JyOZalNBf1GfW4OP5R287aiw2sMVGYQZT1ViRqzWY5AZUvhz+5p X-Received: by 10.98.150.198 with SMTP id s67mr3073014pfk.191.1522244876911; Wed, 28 Mar 2018 06:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522244876; cv=none; d=google.com; s=arc-20160816; b=qge5L4jcP2FaBKB9W+EfTo4FXmE3wLiGcYKVGTzHrB2+xPWbUPifl/xzJCWCM0CT50 lBH200S9i0SGjHLBRQXbQhsiruOfBhUsVwaVCBjsFbPvS7suOQLUHq9nUg5eLBQ5J1ae EIwEQD/Yz36TA6jxQ+mSEIceLeqz0bALYsJOpjgtFdbwNiQs1W2s7CNj4HMqIkQvtut7 yr/maEClv0SCJLp6GQKesOVb0FrDLzBMqW9RAsj33Gf4aYMz1Z9hvYmZnppvnhz7d/1S gruIKrj+kl5Ma1LLMSCSX/Sm7CL66JYGRbFzKA3VNHvCuOzhTGKPnUqS2UP2JwVmHhdo wpqA== 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 :arc-authentication-results; bh=J7D/9y1FFXIAJoox3080jcGlaa6n+G3IMqNAa4Ur50w=; b=Gk6ew7lWID7q30+p8WYxBW1gqm9DVi5HwVHftcEbaLeLB4PJ4crJEoZEA76jBc9vNm 5L/Af6B/t9oiL+nAk3OaSbLBBvW2ZIHKAPAgFBzmciux3gI1bTTghXdmtqj48RFS6LwR UXmB3CIdW9AnN+7JgIWXKUwtc93if1c3F/kqvk02KE3EcecRJl13gsSMfbxfxjW+GVgR NNi1sSHHde8fg1H4ISRYaQKbF6rE37eUVa8lKqmH/a+ZcsHRJRgWm/L2zQdLhFytATsR SMD8p/KWtqnnjsG042JMq3jBwfgvB1O/wIE+d9NXNvbr59rFKg8AoAx7SwfsSzB6s0bQ qO6A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a59-v6si3761503pla.497.2018.03.28.06.47.56; Wed, 28 Mar 2018 06:47:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753305AbeC1Nry (ORCPT + 28 others); Wed, 28 Mar 2018 09:47:54 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:49621 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753098AbeC1Nrw (ORCPT ); Wed, 28 Mar 2018 09:47:52 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0MAysS-1etVvk2G84-00A1IQ; Wed, 28 Mar 2018 15:47:48 +0200 From: Arnd Bergmann To: Bjorn Helgaas Cc: Arnd Bergmann , "Rafael J. Wysocki" , Greg Kroah-Hartman , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pci: move pcie_pme_root_status_cleanup into SUSPEND section Date: Wed, 28 Mar 2018 15:47:18 +0200 Message-Id: <20180328134747.2062348-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:ivlY+y94Cpqa814dri0L2TTX32s9nxpO4i6aQLS13z0NJpHD6QV X6qlQsTmpmWr+ciggIaUUD3hT87IXKVykHebBtl8TftqyZFOC2sO0Kp1zpPBHmTlBQfcY3z YdPnAbuH1kFNjHn1tcnjR2vgUIzctVbUnI3atZeIzlq8v8hjwgKGxg2Q6oqMcet6r4ZzFff 240OFmwVTRnafvYnxbbxg== X-UI-Out-Filterresults: notjunk:1; V01:K0:TFI0PRQpRiY=:hvLAJYJ3WDL+rzpN6AQpI+ V1YgK7bMRprmeS/s35wu6zduNoIIxieKIeRgyjBu3yIcjZNmbqEMekls2e3OhkjVAvFGcsuup Nxh7RohABfSITqAhkZjx1YZsO01b/kAD0w5i555wgAsjRUZRRizWtk1eIstd5C447N9mApLcx ng+j0PLOXTsL0PgKK9cXTZ+QwKis8wJJ6I5AehmVAm9OJMo4GYfX3wjuMuU2S6WHEN7d9TB6C f/e/MKwQ4KUyKopELUVsCcl9qsTKJ6RemG58LPq6VIATvZyE7Z1BETXJsJbI+AePCyYyD06+Z CqQC6uYh92lAhsyyBUGzsjRhjgX6+fW55/zIr5qRfrFYJ4HZekyEDbpSM1HwKQPodqA2a9fiC 6plfh8YqxHcG+R/dlB92mFPTVDGmw6p25kkJpK+aox15bpmjz8pauvsGSYSVtEd448hUwZtSG Xbc4TUqOxS0p8cPVNPVNIocWOxBsxWEhPMLzwVsVaABgTcu9Ajzjdo1/LE9C73beV9D4rJPTz 5ODdhzoMy94m0KSuZrW4/eX2PMMWAcxgHzf+5NgPJBByD7ZeLAYdnEHqzOR8JDEVdi+i2kjs3 Z+pgEDQ5mtCpDs4FSu9z4aPnoKWS7qMYDgUZYZ2cAJMWdf4zYysmKKDgvtZOx2+AKyZEiKyUs hfYIiFm1AuFTO/kVEj2k0q5b4kDfm6NxWayYMdooxmyC/8AzC9WoyyO1PRwAPsowvkGTySZ5C o2rRp7y0k/gEbdZ3Q8qbh2/etSeIYzYBaHhojg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The power management code in pci-driver.c is a maze of #ifdefs, and the newly added pcie_pme_root_status_cleanup function ended up in the wrong one of them, causing a harmless warning in some configurations: drivers/pci/pci-driver.c:527:13: error: 'pcie_pme_root_status_cleanup' defined but not used [-Werror=unused-function] static void pcie_pme_root_status_cleanup(struct pci_dev *pci_dev) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ This moves the definition into the correct #ifdef section. Fixes: 6c4dfc1389e1 ("PCI/PM: Clear PCIe PME Status bit in core, not PCIe port driver") Signed-off-by: Arnd Bergmann --- drivers/pci/pci-driver.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) -- 2.9.0 Reviewed-by: Rafael J. Wysocki diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index b9bca74e9eff..6ace47099fc5 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -524,19 +524,6 @@ static void pci_pm_default_resume_early(struct pci_dev *pci_dev) pci_fixup_device(pci_fixup_resume_early, pci_dev); } -static void pcie_pme_root_status_cleanup(struct pci_dev *pci_dev) -{ - /* - * Some BIOSes forget to clear Root PME Status bits after system - * wakeup, which breaks ACPI-based runtime wakeup on PCI Express. - * Clear those bits now just in case (shouldn't hurt). - */ - if (pci_is_pcie(pci_dev) && - (pci_pcie_type(pci_dev) == PCI_EXP_TYPE_ROOT_PORT || - pci_pcie_type(pci_dev) == PCI_EXP_TYPE_RC_EC)) - pcie_clear_root_pme_status(pci_dev); -} - /* * Default "suspend" method for devices that have no driver provided suspend, * or not even a driver at all (second part). @@ -726,6 +713,18 @@ static void pci_pm_complete(struct device *dev) #endif /* !CONFIG_PM_SLEEP */ #ifdef CONFIG_SUSPEND +static void pcie_pme_root_status_cleanup(struct pci_dev *pci_dev) +{ + /* + * Some BIOSes forget to clear Root PME Status bits after system + * wakeup, which breaks ACPI-based runtime wakeup on PCI Express. + * Clear those bits now just in case (shouldn't hurt). + */ + if (pci_is_pcie(pci_dev) && + (pci_pcie_type(pci_dev) == PCI_EXP_TYPE_ROOT_PORT || + pci_pcie_type(pci_dev) == PCI_EXP_TYPE_RC_EC)) + pcie_clear_root_pme_status(pci_dev); +} static int pci_pm_suspend(struct device *dev) {