From: "Youquan,Song" <youquan.song@linux.intel.com>
To: lenb@kernel.org
Cc: venkatesh.pallipadi@intel.com, kent.liu@intel.com,
chaohong.guo@intel.com, youquan.song@intel.com,
linux-acpi@vger.kernel.org
Subject: [PATCH]acpi c-states: Fix ACPI C3 is wrongly mapped to C2
Date: Sat, 12 Dec 2009 13:14:42 -0500 [thread overview]
Message-ID: <20091212181442.GA22832@youquan-linux.bj.intel.com> (raw)
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));
/*
next reply other threads:[~2009-12-12 10:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-12 18:14 Youquan,Song [this message]
2009-12-12 14:27 ` [PATCH]acpi c-states: Fix ACPI C3 is wrongly mapped to C2 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091212181442.GA22832@youquan-linux.bj.intel.com \
--to=youquan.song@linux.intel.com \
--cc=chaohong.guo@intel.com \
--cc=kent.liu@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=venkatesh.pallipadi@intel.com \
--cc=youquan.song@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox