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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 7603c0553909..8e786b0d665a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -104,7 +104,7 @@ __setup("notsc", notsc_setup);
104/* 104/*
105 * Read TSC and the reference counters. Take care of SMI disturbance 105 * Read TSC and the reference counters. Take care of SMI disturbance
106 */ 106 */
107static u64 __init tsc_read_refs(u64 *pm, u64 *hpet) 107static u64 tsc_read_refs(u64 *pm, u64 *hpet)
108{ 108{
109 u64 t1, t2; 109 u64 t1, t2;
110 int i; 110 int i;
@@ -314,7 +314,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
314 mark_tsc_unstable("cpufreq changes"); 314 mark_tsc_unstable("cpufreq changes");
315 } 315 }
316 316
317 set_cyc2ns_scale(tsc_khz_ref, freq->cpu); 317 set_cyc2ns_scale(tsc_khz, freq->cpu);
318 318
319 return 0; 319 return 0;
320} 320}
@@ -325,6 +325,10 @@ static struct notifier_block time_cpufreq_notifier_block = {
325 325
326static int __init cpufreq_tsc(void) 326static int __init cpufreq_tsc(void)
327{ 327{
328 if (!cpu_has_tsc)
329 return 0;
330 if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
331 return 0;
328 cpufreq_register_notifier(&time_cpufreq_notifier_block, 332 cpufreq_register_notifier(&time_cpufreq_notifier_block,
329 CPUFREQ_TRANSITION_NOTIFIER); 333 CPUFREQ_TRANSITION_NOTIFIER);
330 return 0; 334 return 0;