public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: limit mwait_idle to Intel CPUs
@ 2007-04-05 14:00 Andreas Herrmann
  2007-04-05 14:24 ` Andi Kleen
  0 siblings, 1 reply; 12+ messages in thread
From: Andreas Herrmann @ 2007-04-05 14:00 UTC (permalink / raw)
  To: linux-kernel, Andi Kleen


Commit 991528d7348667924176f3e29addea0675298944
introduced mwait_idle which is supposed to work
for Intel CPUs starting with Core Duo.

AMD Fam10 processors won't enter C1 on mwait.
This patch will enable default_idle for non-Intel
CPUs even if mwait is supported.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
 arch/i386/kernel/process.c   |    4 +++-
 arch/x86_64/kernel/process.c |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 393a67d..e3067e4 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -259,7 +259,9 @@ static void mwait_idle(void)
 
 void __devinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
-	if (cpu_has(c, X86_FEATURE_MWAIT)) {
+	if (cpu_has(c, X86_FEATURE_MWAIT) &&
+	    (c->x86_vendor == X86_VENDOR_INTEL)) {
+
 		printk("monitor/mwait feature present.\n");
 		/*
 		 * Skip, if setup has overridden idle.
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index d8d5ccc..fed830c 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -271,7 +271,8 @@ static void mwait_idle(void)
 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
 	static int printed;
-	if (cpu_has(c, X86_FEATURE_MWAIT)) {
+	if (cpu_has(c, X86_FEATURE_MWAIT) &&
+	    (c->x86_vendor == X86_VENDOR_INTEL)) {
 		/*
 		 * Skip, if setup has overridden idle.
 		 * One CPU supports mwait => All CPUs supports mwait
-- 
1.5.0.6





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

end of thread, other threads:[~2007-04-05 21:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05 14:00 [PATCH] x86: limit mwait_idle to Intel CPUs Andreas Herrmann
2007-04-05 14:24 ` Andi Kleen
2007-04-05 14:44   ` Andreas Herrmann
2007-04-05 15:37     ` Andi Kleen
2007-04-05 16:20       ` Andreas Herrmann
2007-04-05 16:55         ` H. Peter Anvin
2007-04-05 17:06           ` Markus Rechberger
2007-04-05 17:36             ` H. Peter Anvin
2007-04-05 21:12           ` aherrman
2007-04-05 21:19             ` H. Peter Anvin
2007-04-05 17:05         ` Andi Kleen
2007-04-05 14:46   ` Langsdorf, Mark

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