diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-07 01:42:09 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-07 01:42:09 +0100 |
commit | 43d388832bd3e413e9b5e6f3caef4b0844b901af (patch) | |
tree | 0a95011781ad5a4286761fd17ed2f5c285b5e02a /drivers/acpi/pci_root.c | |
parent | ACPI / hotplug: Merge device hot-removal routines (diff) | |
download | linux-43d388832bd3e413e9b5e6f3caef4b0844b901af.tar.xz linux-43d388832bd3e413e9b5e6f3caef4b0844b901af.zip |
ACPI / hotplug: Carry out PCI root eject directly
Since _handle_hotplug_event_root() is run from the ACPI hotplug
workqueue, it doesn't need to queue up a work item to eject a PCI
host bridge on the same workqueue. Instead, it can just carry out
the eject by calling acpi_bus_device_eject() directly, so make that
happen.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r-- | drivers/acpi/pci_root.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index add408b07c93..d77f0bf7eda0 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -592,16 +592,6 @@ static void handle_root_bridge_insertion(acpi_handle handle) acpi_handle_err(handle, "cannot add bridge to acpi list\n"); } -static void handle_root_bridge_removal(struct acpi_device *device) -{ - acpi_status status; - - get_device(&device->dev); - status = acpi_os_hotplug_execute(acpi_bus_hot_remove_device, device); - if (ACPI_FAILURE(status)) - put_device(&device->dev); -} - static void _handle_hotplug_event_root(struct work_struct *work) { struct acpi_pci_root *root; @@ -612,6 +602,7 @@ static void _handle_hotplug_event_root(struct work_struct *work) hp_work = container_of(work, struct acpi_hp_work, work); handle = hp_work->handle; type = hp_work->type; + kfree(hp_work); /* allocated in handle_hotplug_event_bridge */ acpi_scan_lock_acquire(); @@ -641,9 +632,15 @@ static void _handle_hotplug_event_root(struct work_struct *work) /* request device eject */ acpi_handle_printk(KERN_DEBUG, handle, "Device eject notify on %s\n", __func__); - if (root) - handle_root_bridge_removal(root->device); - break; + if (!root) + break; + + get_device(&root->device->dev); + + acpi_scan_lock_release(); + + acpi_bus_device_eject(root->device, ACPI_NOTIFY_EJECT_REQUEST); + return; default: acpi_handle_warn(handle, "notify_handler: unknown event type 0x%x\n", @@ -652,7 +649,6 @@ static void _handle_hotplug_event_root(struct work_struct *work) } acpi_scan_lock_release(); - kfree(hp_work); /* allocated in handle_hotplug_event_bridge */ } static void handle_hotplug_event_root(acpi_handle handle, u32 type, |