Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8e9afb1 authored by Jiang Liu's avatar Jiang Liu Committed by Bjorn Helgaas
Browse files

PCI/ACPI: 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.

Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarTaku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 8ee5bdf3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -626,14 +626,25 @@ 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(device->handle);

	pci_bus_add_devices(root->bus);

	return 0;
}

static int acpi_pci_root_remove(struct acpi_device *device, int type)
{
	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->remove)
			driver->remove(root->device->handle);

	device_set_run_wake(root->bus->bridge, false);
	pci_acpi_remove_bus_pm_notifier(device);