Skip to contentSkip to conversation

ACPI: processor: fix processor_physically_present on UP

PATCH Applied Alex Chiang 2 participants 2 messages Jun 17, 2010 – Jul 12, 2010 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: processor: fix processor_physically_present on UP

The commit 5d554a7bb06 (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.

---

drivers/acpi/processor_core.c +1 -1
index 5128435..e9699aa 100644
@@ -223,7 +223,7 @@ static bool processor_physically_present(acpi_handle handle)
 	type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
 	cpuid = acpi_get_cpuid(handle, type, acpi_id);
 
-	if (cpuid == -1)
+	if ((cpuid == -1) && (num_possible_cpus() > 1))
 		return false;
 
 	return true;
reviewer Applied
#1 lore raw

applied

thanks,
Len Brown, Intel Open Source Technology Center