aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorToshi Kani <toshi.kani@hp.com>2012-11-01 10:42:13 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-14 18:16:04 -0500
commitc5b18e22e74dc7dbd3f7729997a3a553ce761d2b (patch)
tree0f9f0f503ee42498b7023cf0309c86a9644ee585 /drivers/acpi
parent61622accd05b158d05f967b627e72da23d64f2ed (diff)
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: Toshi Kani <toshi.kani@hp.com> Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Tested-by: IgorMammedov <imammedo@redhat.com> Tested-by: Vijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com> Tested-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/processor_driver.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index a4352b88a331..8cc33d0e5d8f 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -695,8 +695,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
695static void acpi_processor_hotplug_notify(acpi_handle handle, 695static void acpi_processor_hotplug_notify(acpi_handle handle,
696 u32 event, void *data) 696 u32 event, void *data)
697{ 697{
698 struct acpi_processor *pr;
699 struct acpi_device *device = NULL; 698 struct acpi_device *device = NULL;
699 struct acpi_eject_event *ej_event = NULL;
700 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ 700 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
701 int result; 701 int result;
702 702
@@ -728,20 +728,27 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
728 "received ACPI_NOTIFY_EJECT_REQUEST\n")); 728 "received ACPI_NOTIFY_EJECT_REQUEST\n"));
729 729
730 if (acpi_bus_get_device(handle, &device)) { 730 if (acpi_bus_get_device(handle, &device)) {
731 printk(KERN_ERR PREFIX 731 pr_err(PREFIX "Device don't exist, dropping EJECT\n");
732 "Device don't exist, dropping EJECT\n");
733 break; 732 break;
734 } 733 }
735 pr = acpi_driver_data(device); 734 if (!acpi_driver_data(device)) {
736 if (!pr) { 735 pr_err(PREFIX "Driver data is NULL, dropping EJECT\n");
737 printk(KERN_ERR PREFIX
738 "Driver data is NULL, dropping EJECT\n");
739 break; 736 break;
740 } 737 }
741 738
742 /* REVISIT: update when eject is supported */ 739 ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
743 ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; 740 if (!ej_event) {
744 break; 741 pr_err(PREFIX "No memory, dropping EJECT\n");
742 break;
743 }
744
745 ej_event->handle = handle;
746 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
747 acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
748 (void *)ej_event);
749
750 /* eject is performed asynchronously */
751 return;
745 752
746 default: 753 default:
747 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 754 ACPI_DEBUG_PRINT((ACPI_DB_INFO,