]> 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 3c36f92160c99c1d157e27a341c3541d9a57bfcb..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;
@@ -358,6 +362,7 @@ static cycle_t read_tsc(void)
                ret : clocksource_tsc.cycle_last;
 }
 
+#ifdef CONFIG_X86_64
 static cycle_t __vsyscall_fn vread_tsc(void)
 {
        cycle_t ret = (cycle_t)vget_cycles();
@@ -365,6 +370,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
        return ret >= __vsyscall_gtod_data.clock.cycle_last ?
                ret : __vsyscall_gtod_data.clock.cycle_last;
 }
+#endif
 
 static struct clocksource clocksource_tsc = {
        .name                   = "tsc",