Skip to content

Commit 035ee28

Browse files
l1kbjorn-helgaas
authored andcommitted
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: 9d26d3a ("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>
1 parent 6af7e4f commit 035ee28

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/pci/remove.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
4040
list_del(&dev->bus_list);
4141
up_write(&pci_bus_sem);
4242

43+
pci_bridge_d3_device_removed(dev);
4344
pci_free_resources(dev);
4445
put_device(&dev->dev);
4546
}
@@ -96,8 +97,6 @@ static void pci_remove_bus_device(struct pci_dev *dev)
9697
dev->subordinate = NULL;
9798
}
9899

99-
pci_bridge_d3_device_removed(dev);
100-
101100
pci_destroy_dev(dev);
102101
}
103102

0 commit comments

Comments
 (0)