OSDN Git Service

PCI/PM: Clear PCIe PME Status bit in core, not PCIe port driver
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 9 Mar 2018 17:06:54 +0000 (11:06 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 12 Mar 2018 14:16:20 +0000 (09:16 -0500)
commita39bd851dccfdcb89db3d9a6b03283aaf15f310c
treee547ae9a6e9191f5a0e365ec20c40b58f5a20fbf
parentdcb0453d71e361d4718bb566d99e6ae498284419
PCI/PM: Clear PCIe PME Status bit in core, not PCIe port driver

fe31e69740ed ("PCI/PCIe: Clear Root PME Status bits early during system
resume") added a .resume_noirq() callback to the PCIe port driver to clear
the PME Status bit during resume to work around a BIOS issue.

The BIOS evidently enabled PME interrupts for ACPI-based runtime wakeups
but did not clear the PME Status bit during resume, which meant PMEs after
resume did not trigger interrupts because PME Status did not transition
from cleared to set.

The fix was in the PCIe port driver, so it worked when CONFIG_PCIEPORTBUS
was set.  But I think we *always* want the fix because the platform may use
PME interrupts even if Linux is built without the PCIe port driver.

Move the fix from the port driver to the PCI core so we can work around
this "PME doesn't work after waking from a sleep state" issue regardless of
CONFIG_PCIEPORTBUS.

[bhelgaas: folded in warning fix from Arnd Bergmann <arnd@arndb.de>:
https://lkml.kernel.org/r/20180328134747.2062348-1-arnd@arndb.de]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-driver.c
drivers/pci/pcie/portdrv_pci.c