@@ -659,10 +659,6 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type)
mutex_lock(&acpi_pci_root_lock);
- list_for_each_entry(driver, &acpi_pci_drivers, node)
- if (driver->remove)
- driver->remove(root->device->handle);
-
/* that root bus could be removed already */
if (!pci_find_bus(root->segment, root->secondary.start)) {
dev_printk(KERN_DEBUG, &device->dev,
@@ -670,6 +666,13 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type)
goto out;
}
+ /* stop normal pci drivers before we stop ioapic and dmar etc */
+ pci_stop_bus_devices(root->bus);
+
+ list_for_each_entry_reverse(driver, &acpi_pci_drivers, node)
+ if (driver->remove)
+ driver->remove(root->device->handle);
+
device_set_run_wake(root->bus->bridge, false);
pci_acpi_remove_bus_pm_notifier(device);
During stop pci drivers, it still need to access ioapic and iommu. So need to make sure those drivers need to be stop at first. Also change the acpi_pci_drivers remove calling sequence to reverse. Signed-off-by: Yinghai Lu <yinghai@kernel.org> --- drivers/acpi/pci_root.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)