aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/remove.c
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2016-09-06 00:20:46 -0400
committerBjorn Helgaas <bhelgaas@google.com>2016-09-13 17:00:18 -0400
commit035ee288ae7ade4152f1c3cf23a587b04fdc526c (patch)
tree2d628d87296e9c18a1e38b9c5575777e2f6c0da6 /drivers/pci/remove.c
parent6af7e4f77259ee946103387372cb159f2e99a6d4 (diff)
PCI: Fix bridge_d3 update on device removal
Starting with v4.8, we allow a PCIe port to runtime suspend to D3hot if the port itself and its children satisfy a number of conditions. Once a child is removed, we recheck those conditions in case the removed device was blocking the port from suspending. The rechecking needs to happen *after* the device has been removed from the bus it resides on. Otherwise when walking the port's subordinate bus in pci_bridge_d3_update(), the device being removed would erroneously still be taken into account. However the device is removed from the bus_list in pci_destroy_dev() and we currently recheck *before* that. Fix it. Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend") Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Rafael J. Wysocki <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pci/remove.c')
-rw-r--r--drivers/pci/remove.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index d1ef7acf6930..f9357e09e9b3 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -40,6 +40,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
40 list_del(&dev->bus_list); 40 list_del(&dev->bus_list);
41 up_write(&pci_bus_sem); 41 up_write(&pci_bus_sem);
42 42
43 pci_bridge_d3_device_removed(dev);
43 pci_free_resources(dev); 44 pci_free_resources(dev);
44 put_device(&dev->dev); 45 put_device(&dev->dev);
45} 46}
@@ -96,8 +97,6 @@ static void pci_remove_bus_device(struct pci_dev *dev)
96 dev->subordinate = NULL; 97 dev->subordinate = NULL;
97 } 98 }
98 99
99 pci_bridge_d3_device_removed(dev);
100
101 pci_destroy_dev(dev); 100 pci_destroy_dev(dev);
102} 101}
103 102