[PATCH] x86_64: On Intel systems when CPU has C3 don't use TSC

On Intel systems generally the TSC stops in C3 or deeper,
so don't use it there. Follows similar logic on i386.

This should fix problems on Meroms.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Andi Kleen and committed by Linus Torvalds 0e5f61b0 260f659b

+12 -4
+12 -4
arch/x86_64/kernel/time.c
··· 28 28 #include <linux/acpi.h> 29 29 #ifdef CONFIG_ACPI 30 30 #include <acpi/achware.h> /* for PM timer frequency */ 31 + #include <acpi/acpi_bus.h> 31 32 #endif 32 33 #include <asm/8253pit.h> 33 34 #include <asm/pgtable.h> ··· 954 953 #ifdef CONFIG_SMP 955 954 if (apic_is_clustered_box()) 956 955 return 1; 957 - /* Intel systems are normally all synchronized. Exceptions 958 - are handled in the check above. */ 959 - if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) 960 - return 0; 961 956 #endif 957 + /* Most intel systems have synchronized TSCs except for 958 + multi node systems */ 959 + if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { 960 + #ifdef CONFIG_ACPI 961 + /* But TSC doesn't tick in C3 so don't use it there */ 962 + if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 100) 963 + return 1; 964 + #endif 965 + return 0; 966 + } 967 + 962 968 /* Assume multi socket systems are not synchronized */ 963 969 return num_present_cpus() > 1; 964 970 }