aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-01-30 07:30:02 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:30:02 -0500
commit316da3b3fc8efa9a5d2c99e0d449f01ff38c6aba (patch)
treebc5ddba05ab44795b39e90079fb088cdfc6e5517
parentdf619e6bafeb8e129aba3173d384544d7fa6e3c2 (diff)
x86: restrict PIT clocksource usage
PIT clocksource is registered unconditionally even when HPET is enabled or when PIT is replaced by the local APIC timer. In both cases PIT can not be used as it is stopped and the readout would be stale. Prevent registering PIT in those cases. patch depends on: x86: offer is_hpet_enabled() on !CONFIG_HPET_TIMER too Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/i8253.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index a42c80745325..0f8f35458a8f 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -197,7 +197,15 @@ static struct clocksource clocksource_pit = {
197 197
198static int __init init_pit_clocksource(void) 198static int __init init_pit_clocksource(void)
199{ 199{
200 if (num_possible_cpus() > 1) /* PIT does not scale! */ 200 /*
201 * Several reasons not to register PIT as a clocksource:
202 *
203 * - On SMP PIT does not scale due to i8253_lock
204 * - when HPET is enabled
205 * - when local APIC timer is active (PIT is switched off)
206 */
207 if (num_possible_cpus() > 1 || is_hpet_enabled() ||
208 pit_clockevent.mode != CLOCK_EVT_MODE_PERIODIC)
201 return 0; 209 return 0;
202 210
203 clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20); 211 clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20);