public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]acpi c-states: Fix ACPI C3 is wrongly mapped to C2
@ 2009-12-12 18:14 Youquan,Song
  2009-12-12 14:27 ` Dominik Brodowski
  2009-12-16  9:28 ` Len Brown
  0 siblings, 2 replies; 10+ messages in thread
From: Youquan,Song @ 2009-12-12 18:14 UTC (permalink / raw)
  To: lenb; +Cc: venkatesh.pallipadi, kent.liu, chaohong.guo, youquan.song,
	linux-acpi

On Nehalem-EX, CPU C3 is mapped to ACPI C3, but C-states information in /proc
 and /sys are conflicting with ACPI C2 mapping and confused user.

/proc/acpi/processor/CPUx/power

    C1:                  type[C1] promotion[--] demotion[--] 
    C2:                  type[C3] promotion[--] demotion[--] 

While
/sys/devices/system/cpu/cpux/cpuidle/state1
ACPI FFH INTEL MWAIT 0x0
1
C1
1000
58312355
323873

/sys/devices/system/cpu/cpux/cpuidle/state2
ACPI FFH INTEL MWAIT 0x10
17
C2
500
83706664055
18926855

In /proc, "type[C3]" mean acpi C3, but from its title "C2:" mean processor
support max C-state is ACPI C2.
In /sys, there is no any information show that this processor support ACPI C3. 

these issues are rooted cause to ACPI C2 miss at some platforms, ACPI C3 is
wrongly mapped to C2.

This patch will invalidate ACPI C2 when platform does not support ACPI C2.

After apply the patch, the C-state information in /proc and /sys are reasonable

/proc/acpi/processor/CPUx/power
    C1:                  type[C1] promotion[--] demotion[--] 
    C2:                  <not supported>
    C3:                  type[C3] promotion[--] demotion[--] 
/sys/devices/system/cpu/cpux/cpuidle/state1/
ACPI FFH INTEL MWAIT 0x0
1
C1
1000
65220
1923

/sys/devices/system/cpu/cpux/cpuidle/state2/
ACPI FFH INTEL MWAIT 0x10
17
C3
500
5794034076
1530073

Signed-off-by: Youquan, Song <youquan.song@intel.com>
---

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index bbd066e..302d656 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -459,6 +459,10 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
 		cx.power = obj->integer.value;
 
 		current_count++;
+
+		if (current_count == 2 && cx.type != ACPI_STATE_C2)
+			current_count++;
+
 		memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx));
 
 		/*

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-12-17  3:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-12 18:14 [PATCH]acpi c-states: Fix ACPI C3 is wrongly mapped to C2 Youquan,Song
2009-12-12 14:27 ` Dominik Brodowski
2009-12-12 23:55   ` Youquan,Song
2009-12-13  8:43     ` Dominik Brodowski
2009-12-14 10:02       ` Youquan,Song
2009-12-14  8:13         ` Dominik Brodowski
2009-12-14 13:12         ` Youquan,Song
2009-12-14 19:12           ` Pallipadi, Venkatesh
2009-12-16  9:28 ` Len Brown
2009-12-17 11:19   ` Youquan,Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox