diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2012-01-19 15:56:50 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-01-19 15:56:50 -0500 |
commit | 282f445a779ed76fca9884fe377bf56a3088b208 (patch) | |
tree | d9abcf526baee0100672851e0a8894c19e762a39 /arch/x86/kernel/tsc.c | |
parent | 68f30fbee19cc67849b9fa8e153ede70758afe81 (diff) | |
parent | 90a4c0f51e8e44111a926be6f4c87af3938a79c3 (diff) |
Merge remote-tracking branch 'linus/master' into x86/urgent
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r-- | arch/x86/kernel/tsc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index f54694611172..a62c201c97ec 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -993,3 +993,23 @@ void __init tsc_init(void) | |||
993 | check_system_tsc_reliable(); | 993 | check_system_tsc_reliable(); |
994 | } | 994 | } |
995 | 995 | ||
996 | #ifdef CONFIG_SMP | ||
997 | /* | ||
998 | * If we have a constant TSC and are using the TSC for the delay loop, | ||
999 | * we can skip clock calibration if another cpu in the same socket has already | ||
1000 | * been calibrated. This assumes that CONSTANT_TSC applies to all | ||
1001 | * cpus in the socket - this should be a safe assumption. | ||
1002 | */ | ||
1003 | unsigned long __cpuinit calibrate_delay_is_known(void) | ||
1004 | { | ||
1005 | int i, cpu = smp_processor_id(); | ||
1006 | |||
1007 | if (!tsc_disabled && !cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC)) | ||
1008 | return 0; | ||
1009 | |||
1010 | for_each_online_cpu(i) | ||
1011 | if (cpu_data(i).phys_proc_id == cpu_data(cpu).phys_proc_id) | ||
1012 | return cpu_data(i).loops_per_jiffy; | ||
1013 | return 0; | ||
1014 | } | ||
1015 | #endif | ||