diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2012-03-22 00:22:36 +0800 |
---|---|---|
committer | Yinghai Lu <yinghai@kernel.org> | 2012-09-17 22:17:14 -0700 |
commit | 2d3a0451620a1ba72d8342077f45265ae988fda5 (patch) | |
tree | a22b06caf489d5f74c2b25b4fbc90c0c0e44a7cc | |
parent | a26b4bc1ea2453f619b44a0d765e9a62fb5fa876 (diff) | |
download | linux-yinghai-2d3a0451620a1ba72d8342077f45265ae988fda5.tar.gz |
ACPI, PCI: Notify acpi_pci_drivers when hot-plugging PCI root bridges
When hot-plugging PCI root bridge, acpi_pci_drivers' add()/remove()
methods should be invoked to notify registered drivers.
-v2: Move add calling to acpi_pci_root_start - Yinghai
-v3: use acpi_pci_root pointer instead of handle - Yinghai
-v3: Fold stop ioapic/iommu drivers after pci devices change in. - Yinghai
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
-rw-r--r-- | drivers/acpi/pci_root.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 325cf5cb3f7014..0ea5ad0f4882b3 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -633,6 +633,11 @@ end: static int acpi_pci_root_start(struct acpi_device *device) { struct acpi_pci_root *root = acpi_driver_data(device); + struct acpi_pci_driver *driver; + + list_for_each_entry(driver, &acpi_pci_drivers, node) + if (driver->add) + driver->add(root); pci_bus_add_devices(root->bus); return 0; @@ -643,6 +648,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type) acpi_status status; acpi_handle handle; struct acpi_pci_root *root = acpi_driver_data(device); + struct acpi_pci_driver *driver; /* that root bus could be removed already */ if (!pci_find_bus(root->segment, root->secondary.start)) { @@ -651,8 +657,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_root_bus(root->bus); + list_for_each_entry_reverse(driver, &acpi_pci_drivers, node) + if (driver->remove) + driver->remove(root); + device_set_run_wake(root->bus->bridge, false); pci_acpi_remove_bus_pm_notifier(device); |