Re: [patch 10/26] ACPI: Prefer _CST over FADT for C-state capabilities
From: Daniel Drake
Date: Tue Dec 13 2005 - 11:00:05 EST
Greg KH wrote:
-stable review patch. If anyone has any objections, please let us know.
------------------
From: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
Note: This ACPI standard compliance may cause regression
on some system, if they have _CST present, but _CST value
is bogus. "nocst" module parameter should workaround
that regression.
http://bugzilla.kernel.org/show_bug.cgi?id=5165
(cherry picked from 883baf7f7e81cca26f4683ae0d25ba48f094cc08 commit)
Signed-off-by: Venkatesh Pallipadi<venkatesh.pallipadi@xxxxxxxxx>
Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
drivers/acpi/processor_idle.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Venkatesh followed up in a private email that a 3rd patch is needed to solve
the hyperthreading slowdown issue. This patch is not yet in Linus' tree (it is
in acpi-test).
Maybe we should drop these patches (10 and 12) until the 3rd patch has been
merged. I haven't been shipping the 3rd patch in Gentoo (yet) so I'm not able
to gauge its effect...
Attaching the 3rd patch anyway.
Daniel
From: Len Brown <len.brown@xxxxxxxxx>
Bug fix for bugzilla #5165 http://bugzilla.kernel.org/show_bug.cgi?id=5165
Incremental changes to earlier patch.
* Changing the polarity of plvl2_up
* Skip promotion/demotion code when not needed.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx>
Index: linux-acpi-2.6/drivers/acpi/processor_idle.c
===================================================================
--- linux-acpi-2.6.orig/drivers/acpi/processor_idle.c
+++ linux-acpi-2.6/drivers/acpi/processor_idle.c
@@ -278,8 +278,6 @@ static void acpi_processor_idle(void)
}
}
- cx->usage++;
-
#ifdef CONFIG_HOTPLUG_CPU
/*
* Check for P_LVL2_UP flag before entering C2 and above on
@@ -287,9 +285,12 @@ static void acpi_processor_idle(void)
* detection phase, to work cleanly with logical CPU hotplug.
*/
if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
- !pr->flags.has_cst && acpi_fadt.plvl2_up)
- cx->type = ACPI_STATE_C1;
+ !pr->flags.has_cst && !acpi_fadt.plvl2_up)
+ cx = &pr->power.states[ACPI_STATE_C1];
#endif
+
+ cx->usage++;
+
/*
* Sleep:
* ------
@@ -378,6 +379,15 @@ static void acpi_processor_idle(void)
next_state = pr->power.state;
+#ifdef CONFIG_HOTPLUG_CPU
+ /* Don't do promotion/demotion */
+ if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) &&
+ !pr->flags.has_cst && !acpi_fadt.plvl2_up) {
+ next_state = cx;
+ goto end;
+ }
+#endif
+
/*
* Promotion?
* ----------
@@ -549,7 +559,7 @@ static int acpi_processor_get_power_info
* Check for P_LVL2_UP flag before entering C2 and above on
* an SMP system.
*/
- if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up)
+ if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
return_VALUE(-ENODEV);
#endif