Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c1c306344669ca40255e36192b101060ffbb1271
Commit:     c1c306344669ca40255e36192b101060ffbb1271
Parent:     d4d25deca49ec2527a634557bf5a6cf449f85deb
Author:     Alexey Starikovskiy <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 26 20:42:19 2007 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Mon Nov 26 20:42:19 2007 +0100

    ACPI: Set max_cstate to 1 for early Opterons.
    
    AMD Opteron processors before CG revision don't like C-states > 1.
    
    This solves the long standing bugzilla #5303 and probably some more
    on affected machines:
    
      http://bugzilla.kernel.org/show_bug.cgi?id=5303
    
    [ [EMAIL PROTECTED]: reworked the patch so it does not wreck ia64 ]
    
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 drivers/acpi/processor_idle.c |    1 +
 include/asm-ia64/acpi.h       |    1 +
 include/asm-x86/acpi.h        |   27 +++++++++++++++++++++++++++
 3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index f996d0e..b52109b 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1658,6 +1658,7 @@ int __cpuinit acpi_processor_power_init(struct 
acpi_processor *pr,
 
        if (!first_run) {
                dmi_check_system(processor_power_dmi_table);
+               max_cstate = acpi_processor_cstate_check(max_cstate);
                if (max_cstate < ACPI_C_STATES_MAX)
                        printk(KERN_NOTICE
                               "ACPI: processor limited to max C-state %d\n",
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 49730ff..81bcd5e 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned int *lock)
 #define acpi_noirq 0   /* ACPI always enabled on IA64 */
 #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
 #define acpi_strict 1  /* no ACPI spec workarounds on IA64 */
+#define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
 static inline void disable_acpi(void) { }
 
 const char *acpi_get_sysname (void);
diff --git a/include/asm-x86/acpi.h b/include/asm-x86/acpi.h
index 0693689..f8a8979 100644
--- a/include/asm-x86/acpi.h
+++ b/include/asm-x86/acpi.h
@@ -1,5 +1,32 @@
+#ifndef _ASM_X86_ACPI_H
+#define _ASM_X86_ACPI_H
+
 #ifdef CONFIG_X86_32
 # include "acpi_32.h"
 #else
 # include "acpi_64.h"
 #endif
+
+#include <asm/processor.h>
+
+/*
+ * Check if the CPU can handle C2 and deeper
+ */
+static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
+{
+       /*
+        * Early models (<=5) of AMD Opterons are not supposed to go into
+        * C2 state.
+        *
+        * Steppings 0x0A and later are good
+        */
+       if (boot_cpu_data.x86 == 0x0F &&
+           boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+           boot_cpu_data.x86_model <= 0x05 &&
+           boot_cpu_data.x86_mask < 0x0A)
+               return 1;
+       else
+               return max_cstate;
+}
+
+#endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to