Commit baecc470 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PCI / PM: Skip bridges in pci_enable_wake()

PCI bridges only have a reason to generate wakeup signals on behalf
of devices below them, so avoid preparing bridges for wakeup directly
in pci_enable_wake().

Also drop the pci_has_subordinate() check from pci_pm_default_resume()
as this will be done by pci_enable_wake() itself now.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 16f73eb0
...@@ -647,9 +647,7 @@ static int pci_legacy_resume(struct device *dev) ...@@ -647,9 +647,7 @@ static int pci_legacy_resume(struct device *dev)
static void pci_pm_default_resume(struct pci_dev *pci_dev) static void pci_pm_default_resume(struct pci_dev *pci_dev)
{ {
pci_fixup_device(pci_fixup_resume, pci_dev); pci_fixup_device(pci_fixup_resume, pci_dev);
pci_enable_wake(pci_dev, PCI_D0, false);
if (!pci_has_subordinate(pci_dev))
pci_enable_wake(pci_dev, PCI_D0, false);
} }
static void pci_pm_default_suspend(struct pci_dev *pci_dev) static void pci_pm_default_suspend(struct pci_dev *pci_dev)
......
...@@ -1912,6 +1912,13 @@ int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) ...@@ -1912,6 +1912,13 @@ int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable)
{ {
int ret = 0; int ret = 0;
/*
* Bridges can only signal wakeup on behalf of subordinate devices,
* but that is set up elsewhere, so skip them.
*/
if (pci_has_subordinate(dev))
return 0;
/* Don't do the same thing twice in a row for one device. */ /* Don't do the same thing twice in a row for one device. */
if (!!enable == !!dev->wakeup_prepared) if (!!enable == !!dev->wakeup_prepared)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment