]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/tsc_sync.c
Merge branch 'x86/irq' into x86/devel
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / tsc_sync.c
index 9125efe66a06bf1b572dc3b136ef92452c03245e..0577825cf89bad5ecdac456fa13d12f4b8e2fa0e 100644 (file)
@@ -46,7 +46,7 @@ static __cpuinit void check_tsc_warp(void)
        cycles_t start, now, prev, end;
        int i;
 
-       start = get_cycles_sync();
+       start = get_cycles();
        /*
         * The measurement runs for 20 msecs:
         */
@@ -61,18 +61,18 @@ static __cpuinit void check_tsc_warp(void)
                 */
                __raw_spin_lock(&sync_lock);
                prev = last_tsc;
-               now = get_cycles_sync();
+               now = get_cycles();
                last_tsc = now;
                __raw_spin_unlock(&sync_lock);
 
                /*
                 * Be nice every now and then (and also check whether
-                * measurement is done [we also insert a 100 million
+                * measurement is done [we also insert a 10 million
                 * loops safety exit, so we dont lock up in case the
                 * TSC readout is totally broken]):
                 */
                if (unlikely(!(i & 7))) {
-                       if (now > end || i > 100000000)
+                       if (now > end || i > 10000000)
                                break;
                        cpu_relax();
                        touch_nmi_watchdog();
@@ -87,7 +87,11 @@ static __cpuinit void check_tsc_warp(void)
                        nr_warps++;
                        __raw_spin_unlock(&sync_lock);
                }
-
+       }
+       if (!(now-start)) {
+               printk("Warning: zero tsc calibration delta: %Ld [max: %Ld]\n",
+                       now-start, end-start);
+               WARN_ON(1);
        }
 }
 
@@ -129,23 +133,23 @@ void __cpuinit check_tsc_sync_source(int cpu)
        while (atomic_read(&stop_count) != cpus-1)
                cpu_relax();
 
-       /*
-        * Reset it - just in case we boot another CPU later:
-        */
-       atomic_set(&start_count, 0);
-
        if (nr_warps) {
                printk("\n");
                printk(KERN_WARNING "Measured %Ld cycles TSC warp between CPUs,"
                                    " turning off TSC clock.\n", max_warp);
                mark_tsc_unstable("check_tsc_sync_source failed");
-               nr_warps = 0;
-               max_warp = 0;
-               last_tsc = 0;
        } else {
                printk(" passed.\n");
        }
 
+       /*
+        * Reset it - just in case we boot another CPU later:
+        */
+       atomic_set(&start_count, 0);
+       nr_warps = 0;
+       max_warp = 0;
+       last_tsc = 0;
+
        /*
         * Let the target continue with the bootup:
         */