blob: 843c7c2db0e913579583da2003f8f3e1bb291cfc [file] [log] [blame]
From f7287dfec69b55d7a6f527fd089fecfebd4fc4de Mon Sep 17 00:00:00 2001
From: Bjorn Helgaas <>
Date: Thu, 10 Oct 2019 16:54:36 -0500
Subject: [PATCH] PCI/PM: Clear PCIe PME Status even for legacy power
commit ec6a75ef8e33fe33f963b916fd902c52a0be33ff upstream.
Previously, pci_pm_resume_noirq() cleared the PME Status bit in the Root
Status register only if the device had no driver or the driver did not
implement legacy power management. It should clear PME Status regardless
of what sort of power management the driver supports, so do this before
checking for legacy power management.
This affects Root Ports and Root Complex Event Collectors, for which the
usual driver is the PCIe portdrv, which implements new power management, so
this change is just on principle, not to fix any actual defects.
Fixes: a39bd851dccf ("PCI/PM: Clear PCIe PME Status bit in core, not PCIe port driver")
Signed-off-by: Bjorn Helgaas <>
Reviewed-by: Rafael J. Wysocki <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 8d912deb92f0..d7389374a6ee 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -923,12 +923,11 @@ static int pci_pm_resume_noirq(struct device *dev)
pci_fixup_device(pci_fixup_resume_early, pci_dev);
+ pcie_pme_root_status_cleanup(pci_dev);
if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume_early(dev);
- pcie_pme_root_status_cleanup(pci_dev);
if (drv && drv->pm && drv->pm->resume_noirq)
error = drv->pm->resume_noirq(dev);