Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 103

kernel-2.6.18-238.el5.src.rpm

From: John Feeney <jfeeney@redhat.com>
Date: Wed, 21 May 2008 11:13:28 -0400
Subject: [acpi] remove processor module errors
Message-id: 48343C18.6030101@redhat.com
O-Subject: [RHEL5.3 PATCH] rm acpi processor module errors
Bugzilla: 228836
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Brian Maly <bmaly@redhat.com>

bz228836
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=228836
acpi processor module displays errors if hyperthreading disabled

Description of problem:
If hyperthreading is disabled via bios (such as on a Dell
Precision 490), an acpi_exception is hit on boot
("AE_NOT_FOUND, Processor Device is not present"). A
relatively uninformative printk is also seen ("Getting
cpuindex for acpiid").

Solution:
acpi_processor_get_info() calls acpi_evaluate_object()
to find the acpi_id for the processor. cpu_index is
returned by convert_acpid_to_cpu(). Refer to
drivers/acpi/processor_core.c.

If hyperthreading is enabled, cpu_index has a non -1
value for each call and the code continues on without
calling acpi_processor_hotadd_init().

When hyperthreading is disabled, cpu_index is set to -1
for the half the calls to acpi_processor_get_info(). As
a result, the code calls acpi_processor_hotadd_init()
when cpu_index is -1 and is_processor_present() is
then called.

is_processor_present() calls for status (_STA) to determine
if the processor is present which it isn't in this situation
and ACPI_EXCEPTION() is called.

Three upstream patches have addressed this issue. The first
changed the logic to look for a successful return and
add some logic to better deal with failure. A second patch
modified the first so an exception was not taken if the
additional processor was not found. Since obtaining status
is required for hotplugging, a debug printk was be used to
indicate hotplugging is not an option if
acpi_evaluate_integer() function failed, as opposed
to an exception since there really is nothing wrong.

The third patch removed the uninformative printk in
acpi_processor_get_info().

Upstream status:
These three patches are documented below:
1. Change check from FAILURE to SUCCESS
cfaf3747ff3d431fba33f75083b7f50f58ae22ff
ACPI Exception (acpi_processor-0677):
AE_NOT_FOUND, Processor Device is not present

According to the ACPI spec 6.3.7,
"If a device object (including the processor object)
does not have an _STA object, then OSPM assumes that
all of the above bits are set,(in other words, the
device is present, enabled, shown in the UI and
funtioning)".

is_processor_present shoud return 1 if the processor
device object exists while it doesn't have an _STA object.

http://bugzilla.kernel.org/show_bug.cgi?id=8570

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

2. Change above so don't get the exception in all failure
cases.
d0ce46f550ebbd765881e8c48f43b66285d798b0
update cfaf3747ff3d431fba33f75083b7f50f58ae22ff
<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=object;h=cfaf3747ff3d431fba33f75083b7f50f58ae22ff>
ACPI: ACPI Exception (): AE_NOT_FOUND, Processor
Device is not present

is_processor_present is only called in the processor
hotplug case, and _STA method is mandatory at this time.

We should ignore those processors that are disabled
in the MADT and don't have _STA methods.
Because they will never exist in this system.
For the processors that don't physically exist but can be
hot plugged later, we still need this debug info.

http://bugzilla.kernel.org/show_bug.cgi?id=8570

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

3. Remove the printk.
d6637b28ffb38f207015c990e481fde5bba233d7
ACPI: delete two spurious ACPI messages
<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d6637b28ffb38f207015c990e481fde5bba233d7>

Venkatesh Pallipadi [Thu, 11 Jan 2007 04:16:36 +0000 (23:16 -0500)]
ACPI: Getting cpuindex for acpiid 0x4

acpi_processor-0742 [00] processor_preregister_:
Error while parsing _PSD domain information. Assuming no coordination

http://bugzilla.kernel.org/show_bug.cgi?id=7286

Note: I combined the three upstream patches into one patch
because upstream patch 1 and 2 dealt with the same code
and third just removed two printks.

Testing:
The resulting patch was built with Brew (task 1325495).
I tested the rpms successfully when hyperthreading was
enabled and then disabled. I also successfully tested it
on a system where hyperthreading could not be disabled.

Acks would be appreciated. Thanks.

diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index b13d644..6b206e2 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -476,9 +476,6 @@ static int acpi_processor_get_info(struct acpi_processor *pr)
 	if (cpu_index == -1) {
 		if (ACPI_FAILURE
 		    (acpi_processor_hotadd_init(pr->handle, &pr->id))) {
-			printk(KERN_ERR PREFIX
-				    "Getting cpuindex for acpiid 0x%x\n",
-				    pr->acpi_id);
 			return -ENODEV;
 		}
 	}
@@ -677,11 +674,19 @@ static int is_processor_present(acpi_handle handle)
 
 
 	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
-	if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
-		ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));
-		return 0;
-	}
-	return 1;
+
+	if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT)) 
+		return 1;
+	/*
+	 * _STA is mandatory for a processor that supports hot plug
+	 */
+	if (status == AE_NOT_FOUND)
+		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+				"Processor does not support hot plug\n"));
+	else
+		ACPI_EXCEPTION((AE_INFO, status,
+				"Processor Device is not present"));
+	return 0;
 }
 
 static
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 6fd174a..2f62eb2 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -736,10 +736,6 @@ int acpi_processor_preregister_performance(
 	}
 
 err_ret:
-	if (retval) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error while parsing _PSD domain information. Assuming no coordination\n"));
-	}
-
 	for_each_possible_cpu(i) {
 		pr = processors[i];
 		if (!pr || !pr->performance)