From 2896e068b6af7fcecb701f2b0da003bd762039cd Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 30 Jan 2008 13:30:02 +0100 Subject: [PATCH] --- yaml --- r: 79696 b: refs/heads/master c: 316da3b3fc8efa9a5d2c99e0d449f01ff38c6aba h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/i8253.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index cf535d251148..7e58451de615 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: df619e6bafeb8e129aba3173d384544d7fa6e3c2 +refs/heads/master: 316da3b3fc8efa9a5d2c99e0d449f01ff38c6aba diff --git a/trunk/arch/x86/kernel/i8253.c b/trunk/arch/x86/kernel/i8253.c index a42c80745325..0f8f35458a8f 100644 --- a/trunk/arch/x86/kernel/i8253.c +++ b/trunk/arch/x86/kernel/i8253.c @@ -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);