]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/i8253.c
x86: restrict PIT clocksource usage
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / i8253.c
index 5cc8841ca2c695bfeb6c514f0e461f1294312cc0..0f8f35458a8f49397430521c04a69a8cf4b6ffb0 100644 (file)
@@ -86,7 +86,7 @@ static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
  * On UP the PIT can serve all of the possible timer functions. On SMP systems
  * it can be solely used for the global tick.
  *
- * The profiling and update capabilites are switched off once the local apic is
+ * The profiling and update capabilities are switched off once the local apic is
  * registered. This mechanism replaces the previous #ifdef LOCAL_APIC -
  * !using_apic_timer decisions in do_timer_interrupt_hook()
  */
@@ -197,7 +197,15 @@ static struct clocksource clocksource_pit = {
 
 static int __init init_pit_clocksource(void)
 {
-       if (num_possible_cpus() > 1) /* PIT does not scale! */
+        /*
+         * Several reasons not to register PIT as a clocksource:
+         *
+         * - On SMP PIT does not scale due to i8253_lock
+         * - when HPET is enabled
+         * - when local APIC timer is active (PIT is switched off)
+         */
+       if (num_possible_cpus() > 1 || is_hpet_enabled() ||
+           pit_clockevent.mode != CLOCK_EVT_MODE_PERIODIC)
                return 0;
 
        clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20);