Commit 9f1eb99c authored by Zhang Rui's avatar Zhang Rui Committed by Andi Kleen

create sysfs link from acpi device to sysdev for cpu

Sys I/F under acpi device node and sysdev device node are both
needed for cpu hot-removal. User space need this link so that
they know they are poking the sys I/F for the same cpu.
http://bugzilla.kernel.org/show_bug.cgi?id=9772Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
parent b62b8ef9
...@@ -621,7 +621,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) ...@@ -621,7 +621,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
int result = 0; int result = 0;
acpi_status status = AE_OK; acpi_status status = AE_OK;
struct acpi_processor *pr; struct acpi_processor *pr;
struct sys_device *sysdev;
pr = acpi_driver_data(device); pr = acpi_driver_data(device);
...@@ -652,6 +652,10 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device) ...@@ -652,6 +652,10 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
if (result) if (result)
goto end; goto end;
sysdev = get_cpu_sysdev(pr->id);
if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
return -EFAULT;
status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
acpi_processor_notify, pr); acpi_processor_notify, pr);
...@@ -810,6 +814,8 @@ static int acpi_processor_remove(struct acpi_device *device, int type) ...@@ -810,6 +814,8 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY, status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
acpi_processor_notify); acpi_processor_notify);
sysfs_remove_link(&device->dev.kobj, "sysdev");
acpi_processor_remove_fs(device); acpi_processor_remove_fs(device);
if (pr->cdev) { if (pr->cdev) {
......
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