]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: processor: fix processor_physically_present on UP
authorAlex Chiang <achiang@canonical.com>
Thu, 17 Jun 2010 15:08:54 +0000 (09:08 -0600)
committerLen Brown <len.brown@intel.com>
Mon, 12 Jul 2010 17:28:34 +0000 (13:28 -0400)
commite795834dde66393d06b31b4d9cb2b4b216c15e66
tree9c8de900d3123bd158a0c87304f87bda30a791c8
parent2840b6ede98ec5b35047b4160018c90e3d833005
ACPI: processor: fix processor_physically_present on UP

The commit 7d863967638 (ACPI: processor: add internal
processor_physically_present()) is broken on uniprocessor (UP)
configurations, as acpi_get_cpuid() will always return -1.

We use the value of num_possible_cpus() to tell us whether we got
an invalid cpuid from acpi_get_cpuid() in the SMP case, or if
instead, we are UP, in which case num_possible_cpus() is #defined
as 1.

We use num_possible_cpus() instead of num_online_cpus() to
protect ourselves against the scenario of CPU hotplug, and we've
taken down all the CPUs except one.

Thanks to Jan Pogadl for initial report and analysis and Chen
Gong for review.

https://bugzilla.kernel.org/show_bug.cgi?id=16357

Reported-by: Jan Pogadl <pogadl.jan@googlemail.com>:
Reviewed-by: Chen Gong <gong.chen@linux.intel.com>
Signed-off-by: Alex Chiang <achiang@canonical.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/processor_core.c