diff options
author | Alexey Starikovskiy <aystarik@gmail.com> | 2007-11-26 14:42:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-11-26 14:42:19 -0500 |
commit | c1c306344669ca40255e36192b101060ffbb1271 (patch) | |
tree | 292c7936d91b8ed2febb3e2902de41d0e6c84bca | |
parent | d4d25deca49ec2527a634557bf5a6cf449f85deb (diff) |
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
[ tglx@linutronix.de: reworked the patch so it does not wreck ia64 ]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | drivers/acpi/processor_idle.c | 1 | ||||
-rw-r--r-- | include/asm-ia64/acpi.h | 1 | ||||
-rw-r--r-- | 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 f996d0e37689..b52109bd06d2 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, | |||
1658 | 1658 | ||
1659 | if (!first_run) { | 1659 | if (!first_run) { |
1660 | dmi_check_system(processor_power_dmi_table); | 1660 | dmi_check_system(processor_power_dmi_table); |
1661 | max_cstate = acpi_processor_cstate_check(max_cstate); | ||
1661 | if (max_cstate < ACPI_C_STATES_MAX) | 1662 | if (max_cstate < ACPI_C_STATES_MAX) |
1662 | printk(KERN_NOTICE | 1663 | printk(KERN_NOTICE |
1663 | "ACPI: processor limited to max C-state %d\n", | 1664 | "ACPI: processor limited to max C-state %d\n", |
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h index 49730ffbbae4..81bcd5e51789 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) | |||
94 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ | 94 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ |
95 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ | 95 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ |
96 | #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ | 96 | #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ |
97 | #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ | ||
97 | static inline void disable_acpi(void) { } | 98 | static inline void disable_acpi(void) { } |
98 | 99 | ||
99 | const char *acpi_get_sysname (void); | 100 | const char *acpi_get_sysname (void); |
diff --git a/include/asm-x86/acpi.h b/include/asm-x86/acpi.h index 0693689d4146..f8a89793ac8c 100644 --- a/include/asm-x86/acpi.h +++ b/include/asm-x86/acpi.h | |||
@@ -1,5 +1,32 @@ | |||
1 | #ifndef _ASM_X86_ACPI_H | ||
2 | #define _ASM_X86_ACPI_H | ||
3 | |||
1 | #ifdef CONFIG_X86_32 | 4 | #ifdef CONFIG_X86_32 |
2 | # include "acpi_32.h" | 5 | # include "acpi_32.h" |
3 | #else | 6 | #else |
4 | # include "acpi_64.h" | 7 | # include "acpi_64.h" |
5 | #endif | 8 | #endif |
9 | |||
10 | #include <asm/processor.h> | ||
11 | |||
12 | /* | ||
13 | * Check if the CPU can handle C2 and deeper | ||
14 | */ | ||
15 | static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate) | ||
16 | { | ||
17 | /* | ||
18 | * Early models (<=5) of AMD Opterons are not supposed to go into | ||
19 | * C2 state. | ||
20 | * | ||
21 | * Steppings 0x0A and later are good | ||
22 | */ | ||
23 | if (boot_cpu_data.x86 == 0x0F && | ||
24 | boot_cpu_data.x86_vendor == X86_VENDOR_AMD && | ||
25 | boot_cpu_data.x86_model <= 0x05 && | ||
26 | boot_cpu_data.x86_mask < 0x0A) | ||
27 | return 1; | ||
28 | else | ||
29 | return max_cstate; | ||
30 | } | ||
31 | |||
32 | #endif | ||