From: Bhavana Nagendra <bnagendr@redhat.com> Date: Mon, 14 Jan 2008 14:29:01 -0500 Subject: [x86] fix TSC feature flag check on AMD Message-id: 20080114192900.19849.86639.sendpatchset@localhost.localdomain O-Subject: [RHEL5.2 PATCH] Fix a bug in the TSC synchronize code Bugzilla: 428479 Resolves BZ 428479 The code snippet that checks the constant TSC feature flag (X86_FEATURE_CONSTANT_TSC) was in the wrong place, that would cause it to not be executed on AMD systems. Brew build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1109674 Please ACK. Acked-by: Brian Maly <bmaly@redhat.com> Acked-by: Alexander Viro <aviro@redhat.com> diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index efa5efd..867760d 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c @@ -1022,6 +1022,12 @@ __cpuinit int unsynchronized_tsc(void) if (apic_is_clustered_box()) return 1; #endif + + /* AMD systems with constant TSCs have synchronized clocks */ + if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && + (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))) + return 0; + /* Most intel systems have synchronized TSCs except for multi node systems */ if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { @@ -1029,11 +1035,6 @@ __cpuinit int unsynchronized_tsc(void) /* But TSC doesn't tick in C3 so don't use it there */ if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 1000) return 1; - - /* AMD systems with constant TSCs have synchronized clocks */ - if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && - (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))) - return 0; #endif return 0; }