aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/tsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r--arch/x86/kernel/tsc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 2c9cf0fd78f5..c0dd5b603749 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -995,3 +995,23 @@ void __init tsc_init(void)
995 check_system_tsc_reliable(); 995 check_system_tsc_reliable();
996} 996}
997 997
998#ifdef CONFIG_SMP
999/*
1000 * If we have a constant TSC and are using the TSC for the delay loop,
1001 * we can skip clock calibration if another cpu in the same socket has already
1002 * been calibrated. This assumes that CONSTANT_TSC applies to all
1003 * cpus in the socket - this should be a safe assumption.
1004 */
1005unsigned long __cpuinit calibrate_delay_is_known(void)
1006{
1007 int i, cpu = smp_processor_id();
1008
1009 if (!tsc_disabled && !cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC))
1010 return 0;
1011
1012 for_each_online_cpu(i)
1013 if (cpu_data(i).phys_proc_id == cpu_data(cpu).phys_proc_id)
1014 return cpu_data(i).loops_per_jiffy;
1015 return 0;
1016}
1017#endif