]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/tsc.c
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6] / arch / x86 / kernel / tsc.c
index 7603c0553909efa29718b6857cda56ba2469cd4f..8e786b0d665a42e1f24dc7a068ec21fa0a654eeb 100644 (file)
@@ -104,7 +104,7 @@ __setup("notsc", notsc_setup);
 /*
  * Read TSC and the reference counters. Take care of SMI disturbance
  */
-static u64 __init tsc_read_refs(u64 *pm, u64 *hpet)
+static u64 tsc_read_refs(u64 *pm, u64 *hpet)
 {
        u64 t1, t2;
        int i;
@@ -314,7 +314,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
                        mark_tsc_unstable("cpufreq changes");
        }
 
-       set_cyc2ns_scale(tsc_khz_ref, freq->cpu);
+       set_cyc2ns_scale(tsc_khz, freq->cpu);
 
        return 0;
 }
@@ -325,6 +325,10 @@ static struct notifier_block time_cpufreq_notifier_block = {
 
 static int __init cpufreq_tsc(void)
 {
+       if (!cpu_has_tsc)
+               return 0;
+       if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
+               return 0;
        cpufreq_register_notifier(&time_cpufreq_notifier_block,
                                CPUFREQ_TRANSITION_NOTIFIER);
        return 0;