Commit c5b18e22 authored by Toshi Kani's avatar Toshi Kani Committed by Rafael J. Wysocki

ACPI: Add ACPI CPU hot-remove support

Added support of CPU hot-remove via an ACPI eject notification.
It calls acpi_bus_hot_remove_device(), which shares the same code
path with the sysfs eject operation.  acpi_os_hotplug_execute()
runs the hot-remove operation in kacpi_hotplug_wq and serializes
it between ACPI hot-remove and sysfs eject requests.
Signed-off-by: default avatarToshi Kani <toshi.kani@hp.com>
Reviewed-by: default avatarYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Tested-by: default avatarIgorMammedov <imammedo@redhat.com>
Tested-by: default avatarVijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
Tested-by: default avatarPrarit Bhargava <prarit@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 61622acc
...@@ -695,8 +695,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device) ...@@ -695,8 +695,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
static void acpi_processor_hotplug_notify(acpi_handle handle, static void acpi_processor_hotplug_notify(acpi_handle handle,
u32 event, void *data) u32 event, void *data)
{ {
struct acpi_processor *pr;
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_eject_event *ej_event = NULL;
u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
int result; int result;
...@@ -728,20 +728,27 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, ...@@ -728,20 +728,27 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
"received ACPI_NOTIFY_EJECT_REQUEST\n")); "received ACPI_NOTIFY_EJECT_REQUEST\n"));
if (acpi_bus_get_device(handle, &device)) { if (acpi_bus_get_device(handle, &device)) {
printk(KERN_ERR PREFIX pr_err(PREFIX "Device don't exist, dropping EJECT\n");
"Device don't exist, dropping EJECT\n");
break; break;
} }
pr = acpi_driver_data(device); if (!acpi_driver_data(device)) {
if (!pr) { pr_err(PREFIX "Driver data is NULL, dropping EJECT\n");
printk(KERN_ERR PREFIX
"Driver data is NULL, dropping EJECT\n");
break; break;
} }
/* REVISIT: update when eject is supported */ ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; if (!ej_event) {
break; pr_err(PREFIX "No memory, dropping EJECT\n");
break;
}
ej_event->handle = handle;
ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
(void *)ej_event);
/* eject is performed asynchronously */
return;
default: default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment