Skip to content

Commit

Permalink
PCI/ACPI: Always resume devices on ACPI wakeup notifications
Browse files Browse the repository at this point in the history
It turns out that the _Lxx control methods provided by some BIOSes
clear the PME Status bit of PCI devices they handle, which means that
pci_acpi_wake_dev() cannot really use that bit to check whether or
not the device has signalled wakeup.

One symptom of the problem is, for example, that when an affected PCI
USB controller is runtime-suspended, then plugging in a new USB device
into one of the controller's ports will not wake up the controller,
which should happen.

For this reason, make pci_acpi_wake_dev() always attempt to resume
the device it is called for regardless of the device's PME Status bit
value (that bit still has to be cleared if set at this point,
though).

Reported-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Matthew Garrett <mjg59@srcf.ucam.org>
CC: stable@vger.kernel.org	# v3.7+
  • Loading branch information
Rafael J. Wysocki authored and Bjorn Helgaas committed Apr 3, 2013
1 parent 6e0eda3 commit 24ad0ef
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/pci/pci-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context)
return;
}

if (!pci_dev->pm_cap || !pci_dev->pme_support
|| pci_check_pme_status(pci_dev)) {
if (pci_dev->pme_poll)
pci_dev->pme_poll = false;
/* Clear PME Status if set. */
if (pci_dev->pme_support)
pci_check_pme_status(pci_dev);

pci_wakeup_event(pci_dev);
pm_runtime_resume(&pci_dev->dev);
}
if (pci_dev->pme_poll)
pci_dev->pme_poll = false;

pci_wakeup_event(pci_dev);
pm_runtime_resume(&pci_dev->dev);

if (pci_dev->subordinate)
pci_pme_wakeup_bus(pci_dev->subordinate);
Expand Down

0 comments on commit 24ad0ef

Please sign in to comment.