Skip to content

Commit 4716a45

Browse files
rjwysockijbarnes993
authored andcommitted
PCI/ACPI/PM: Avoid resuming devices that don't signal PME
Modify pci_acpi_wake_dev() to avoid resuming PME-capable devices whose PME Status bits are not set, which may happen currently if several devices are associated with the same wakeup GPE and all of them are notified whenever at least one of them signals PME. Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
1 parent ab4ca78 commit 4716a45

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/pci/pci-acpi.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,20 @@ static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context)
4545
{
4646
struct pci_dev *pci_dev = context;
4747

48-
if (event == ACPI_NOTIFY_DEVICE_WAKE && pci_dev) {
48+
if (event != ACPI_NOTIFY_DEVICE_WAKE || !pci_dev)
49+
return;
50+
51+
if (!pci_dev->pm_cap || !pci_dev->pme_support
52+
|| pci_check_pme_status(pci_dev)) {
4953
if (pci_dev->pme_poll)
5054
pci_dev->pme_poll = false;
5155

5256
pci_wakeup_event(pci_dev);
53-
pci_check_pme_status(pci_dev);
5457
pm_runtime_resume(&pci_dev->dev);
55-
if (pci_dev->subordinate)
56-
pci_pme_wakeup_bus(pci_dev->subordinate);
5758
}
59+
60+
if (pci_dev->subordinate)
61+
pci_pme_wakeup_bus(pci_dev->subordinate);
5862
}
5963

6064
/**

0 commit comments

Comments
 (0)