Skip to content

Commit 2d92393

Browse files
Mani-Sadhasivamkwilczynski
authored andcommitted
PCI/pwrctrl: Move pci_pwrctrl_unregister() to pci_destroy_dev()
The PCI core will try to access the devices even after pci_stop_dev() for things like Data Object Exchange (DOE), ASPM, etc. So, move pci_pwrctrl_unregister() to the near end of pci_destroy_dev() to make sure that the devices are powered down only after the PCI core is done with them. Suggested-by: Lukas Wunner <[email protected]> Reviewed-by: Lukas Wunner <[email protected]> Tested-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 957f40d commit 2d92393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/remove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ static void pci_stop_dev(struct pci_dev *dev)
4141
if (!pci_dev_test_and_clear_added(dev))
4242
return;
4343

44-
pci_pwrctrl_unregister(&dev->dev);
4544
device_release_driver(&dev->dev);
4645
pci_proc_detach_device(dev);
4746
pci_remove_sysfs_dev_files(dev);
@@ -64,6 +63,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
6463
pci_doe_destroy(dev);
6564
pcie_aspm_exit_link_state(dev);
6665
pci_bridge_d3_update(dev);
66+
pci_pwrctrl_unregister(&dev->dev);
6767
pci_free_resources(dev);
6868
put_device(&dev->dev);
6969
}

0 commit comments

Comments
 (0)