Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   UBUNTU: SAUCE: do not make sysdev links for processors which are not booted (http://www.linux-archive.org/ubuntu-kernel-team/269753-ubuntu-sauce-do-not-make-sysdev-links-processors-not-booted.html)

Andy Whitcroft 03-25-2009 10:33 AM

UBUNTU: SAUCE: do not make sysdev links for processors which are not booted
 
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@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


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team


All times are GMT. The time now is 01:28 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.