[PATCH 1/1] UBUNTU: SAUCE: do not make sysdev links for processors which are not booted
Andy Whitcroft
apw at canonical.com
Wed Mar 25 11:33:25 UTC 2009
Bug: #295091
When booting if a CPU cannot be started we will not initialise its sysdev
object. Later when we initialise ACPI we find both CPUS in the ACPI data
and use that to build sysfs links for each. When the CPU is not booted
these links have nothing to link to and we panic while building the links.
Do not make or remove the links for CPUs which did not boot.
Signed-off-by: Andy Whitcroft <apw at canonical.com>
---
drivers/acpi/processor_core.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index c703eab..6705259 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -654,7 +654,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
goto end;
sysdev = get_cpu_sysdev(pr->id);
- if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
+ if (sysdev &&
+ sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev"))
return -EFAULT;
status = acpi_install_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
@@ -793,7 +794,8 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(pr->handle, ACPI_DEVICE_NOTIFY,
acpi_processor_notify);
- sysfs_remove_link(&device->dev.kobj, "sysdev");
+ if (get_cpu_sysdev(pr->id))
+ sysfs_remove_link(&device->dev.kobj, "sysdev");
acpi_processor_remove_fs(device);
--
1.6.1.2.419.g0d87e
More information about the kernel-team
mailing list