From c1c306344669ca40255e36192b101060ffbb1271 Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Mon, 26 Nov 2007 20:42:19 +0100 Subject: 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 Signed-off-by: Ingo Molnar --- include/asm-ia64/acpi.h | 1 + include/asm-x86/acpi.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'include') diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h index 49730ffbbae..81bcd5e5178 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 0693689d414..f8a89793ac8 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 + +/* + * 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 -- cgit v1.2.3 From aafab10d3f6b68150ec9fe75b1462764fd45b728 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 26 Nov 2007 20:42:19 +0100 Subject: x86: fix ACPI compile for LOCAL_APIC=n ACPI processor idle code references local_apic_timer_c2_ok, which is not available when LOCAL_APIC is disabled. Define local_apic_timer_c2_ok as a constant, when LOCAL_APIC=n Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/asm-x86/apic_32.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-x86/apic_32.h b/include/asm-x86/apic_32.h index 4091b33dcb1..be158b27d54 100644 --- a/include/asm-x86/apic_32.h +++ b/include/asm-x86/apic_32.h @@ -120,6 +120,7 @@ extern int local_apic_timer_disabled; #else /* !CONFIG_X86_LOCAL_APIC */ static inline void lapic_shutdown(void) { } +#define local_apic_timer_c2_ok 1 #endif /* !CONFIG_X86_LOCAL_APIC */ -- cgit v1.2.3 From 52bfb36050c8529d9031d2c2513b281a360922ec Mon Sep 17 00:00:00 2001 From: John Stultz Date: Mon, 26 Nov 2007 20:42:19 +0100 Subject: time: add ADJ_OFFSET_SS_READ Michael Kerrisk reported that a long standing bug in the adjtimex() system call causes glibc's adjtime(3) function to deliver the wrong results if 'delta' is NULL. add the ADJ_OFFSET_SS_READ API detail, which will be used by glibc to fix this API compatibility bug. Also see: http://bugzilla.kernel.org/show_bug.cgi?id=6761 [ mingo@elte.hu: added patch description and made it backwards compatible ] NOTE: the new flag is defined 0xa001 so that it returns -EINVAL on older kernels - this way glibc can use it safely. Suggested by Ulrich Drepper. Acked-by: Ulrich Drepper Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/linux/timex.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/timex.h b/include/linux/timex.h index 37ac3ff90fa..24c6a2b5951 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -137,6 +137,7 @@ struct timex { #define ADJ_TIMECONST 0x0020 /* pll time constant */ #define ADJ_TICK 0x4000 /* tick value */ #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ +#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ /* xntp 3.4 compatibility names */ #define MOD_OFFSET ADJ_OFFSET -- cgit v1.2.3