]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/process_64.c
x86: use the correct cpuid method to detect MWAIT support for C states
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / process_64.c
index 4e65ae8a54bf2c3c6d2a6750e1da71f4b36bae0e..dbe0a846ec52a2ec23033c4e480a63f8495eba85 100644 (file)
@@ -280,10 +280,19 @@ static void mwait_idle(void)
        }
 }
 
+
+static int mwait_usable(const struct cpuinfo_x86 *c)
+{
+       if (force_mwait)
+               return 1;
+       /* Any C1 states supported? */
+       return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
+}
+
 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) && mwait_usable(c)) {
                /*
                 * Skip, if setup has overridden idle.
                 * One CPU supports mwait => All CPUs supports mwait