Skip to content

Commit 6496ebd

Browse files
AlanSternbjorn-helgaas
authored andcommitted
PCI: Check for PME in targeted sleep state
One some systems, the firmware does not allow certain PCI devices to be put in deep D-states. This can cause problems for wakeup signalling, if the device does not support PME# in the deepest allowed suspend state. For example, Pierre reports that on his system, ACPI does not permit his xHCI host controller to go into D3 during runtime suspend -- but D3 is the only state in which the controller can generate PME# signals. As a result, the controller goes into runtime suspend but never wakes up, so it doesn't work properly. USB devices plugged into the controller are never detected. If the device relies on PME# for wakeup signals but is not capable of generating PME# in the target state, the PCI core should accurately report that it cannot do wakeup from runtime suspend. This patch modifies the pci_dev_run_wake() routine to add this check. Reported-by: Pierre de Villemereuil <flyos@mailoo.org> Tested-by: Pierre de Villemereuil <flyos@mailoo.org> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> CC: stable@vger.kernel.org CC: Lukas Wunner <lukas@wunner.de>
1 parent 1001354 commit 6496ebd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pci/pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,6 +2106,10 @@ bool pci_dev_run_wake(struct pci_dev *dev)
21062106
if (!dev->pme_support)
21072107
return false;
21082108

2109+
/* PME-capable in principle, but not from the intended sleep state */
2110+
if (!pci_pme_capable(dev, pci_target_state(dev)))
2111+
return false;
2112+
21092113
while (bus->parent) {
21102114
struct pci_dev *bridge = bus->self;
21112115

0 commit comments

Comments
 (0)