summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2016-10-21 16:45:38 -0400
committerBen Hutchings <ben@decadent.org.uk>2017-03-16 02:26:19 +0000
commit905b97f31d7cf0c45d42d0d21fb0b1bd25f14aa1 (patch)
tree60279cade0aa8dd45bd149c485166a8f72b981c0 /drivers/pci
parent9ba955cdb6ad89532c7f47c6a6451faf8c112fa7 (diff)
downloadlinux-stable-905b97f31d7cf0c45d42d0d21fb0b1bd25f14aa1.tar.gz
linux-stable-905b97f31d7cf0c45d42d0d21fb0b1bd25f14aa1.tar.bz2
linux-stable-905b97f31d7cf0c45d42d0d21fb0b1bd25f14aa1.zip
PCI: Check for PME in targeted sleep state
commit 6496ebd7edf446fccf8266a1a70ffcb64252593e upstream. 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: Lukas Wunner <lukas@wunner.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 3e981329c7a9..2e54269f5458 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1982,6 +1982,10 @@ bool pci_dev_run_wake(struct pci_dev *dev)
if (!dev->pme_support)
return false;
+ /* PME-capable in principle, but not from the intended sleep state */
+ if (!pci_pme_capable(dev, pci_target_state(dev)))
+ return false;
+
while (bus->parent) {
struct pci_dev *bridge = bus->self;