Merge branches 'core-fixes-for-linus', 'x86-fixes-for-linus', 'timers-fixes-for-linus...
[pandora-kernel.git] / arch / x86 / kernel / tsc.c
index 356a0d4..ffe5755 100644 (file)
@@ -464,7 +464,7 @@ unsigned long native_calibrate_tsc(void)
                tsc_pit_min = min(tsc_pit_min, tsc_pit_khz);
 
                /* hpet or pmtimer available ? */
-               if (!hpet && !ref1 && !ref2)
+               if (ref1 == ref2)
                        continue;
 
                /* Check, whether the sampling was disturbed by an SMI */
@@ -659,7 +659,7 @@ void restore_sched_clock_state(void)
 
        local_irq_save(flags);
 
-       __get_cpu_var(cyc2ns_offset) = 0;
+       __this_cpu_write(cyc2ns_offset, 0);
        offset = cyc2ns_suspend - sched_clock();
 
        for_each_possible_cpu(cpu)
@@ -935,7 +935,7 @@ static void tsc_refine_calibration_work(struct work_struct *work)
        tsc_stop = tsc_read_refs(&ref_stop, hpet);
 
        /* hpet or pmtimer available ? */
-       if (!hpet && !ref_start && !ref_stop)
+       if (ref_start == ref_stop)
                goto out;
 
        /* Check, whether the sampling was disturbed by an SMI */
@@ -965,7 +965,7 @@ out:
 
 static int __init init_tsc_clocksource(void)
 {
-       if (!cpu_has_tsc || tsc_disabled > 0)
+       if (!cpu_has_tsc || tsc_disabled > 0 || !tsc_khz)
                return 0;
 
        if (tsc_clocksource_reliable)