[PATCH] Platform SMIs and their interferance with tsc based delay calibration
[pandora-kernel.git] / arch / i386 / kernel / timers / timer_tsc.c
index 7926d96..27f08ae 100644 (file)
@@ -320,6 +320,26 @@ core_initcall(cpufreq_tsc);
 static inline void cpufreq_delayed_get(void) { return; }
 #endif 
 
+int recalibrate_cpu_khz(void)
+{
+#ifndef CONFIG_SMP
+       unsigned long cpu_khz_old = cpu_khz;
+
+       if (cpu_has_tsc) {
+               init_cpu_khz();
+               cpu_data[0].loops_per_jiffy =
+                   cpufreq_scale(cpu_data[0].loops_per_jiffy,
+                                 cpu_khz_old,
+                                 cpu_khz);
+               return 0;
+       } else
+               return -ENODEV;
+#else
+       return -ENODEV;
+#endif
+}
+EXPORT_SYMBOL(recalibrate_cpu_khz);
+
 static void mark_offset_tsc(void)
 {
        unsigned long lost,delay;
@@ -552,6 +572,7 @@ static struct timer_opts timer_tsc = {
        .get_offset = get_offset_tsc,
        .monotonic_clock = monotonic_clock_tsc,
        .delay = delay_tsc,
+       .read_timer = read_timer_tsc,
 };
 
 struct init_timer_opts __initdata timer_tsc_init = {