aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2018-09-27 17:53:53 -0400
committerBjorn Helgaas <bhelgaas@google.com>2018-10-02 17:04:40 -0400
commitac86e8eeb0542d1089d8cba55884eeeb9410f027 (patch)
tree663a466dff644a359c6f7185072244961bc823ff
parentf0157160b359b1d263ee9d4e0a435a7ad85bbcea (diff)
PCI: Do not skip power-managed bridges in pci_enable_wake()
Commit baecc470d5fd ("PCI / PM: Skip bridges in pci_enable_wake()") changed pci_enable_wake() so that all bridges are skipped when wakeup is enabled (or disabled) with the reasoning that bridges can only signal wakeup on behalf of their subordinate devices. However, there are bridges that can signal wakeup themselves. For example PCIe downstream and root ports supporting hotplug may signal wakeup upon hotplug event. For this reason change pci_enable_wake() so that it skips all bridges except those that we power manage (->bridge_d3 is set). Those are the ones that can go into low power states and may need to signal wakeup. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/pci/pci.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4b0b1d0548f0..4a1b1f76dc92 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2137,10 +2137,13 @@ static int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable
2137 int ret = 0; 2137 int ret = 0;
2138 2138
2139 /* 2139 /*
2140 * Bridges can only signal wakeup on behalf of subordinate devices, 2140 * Bridges that are not power-manageable directly only signal
2141 * but that is set up elsewhere, so skip them. 2141 * wakeup on behalf of subordinate devices which is set up
2142 * elsewhere, so skip them. However, bridges that are
2143 * power-manageable may signal wakeup for themselves (for example,
2144 * on a hotplug event) and they need to be covered here.
2142 */ 2145 */
2143 if (pci_has_subordinate(dev)) 2146 if (!pci_power_manageable(dev))
2144 return 0; 2147 return 0;
2145 2148
2146 /* Don't do the same thing twice in a row for one device. */ 2149 /* Don't do the same thing twice in a row for one device. */