Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=316da3b3fc8efa9a5d2c99e0d449f01ff38c6aba
Commit:     316da3b3fc8efa9a5d2c99e0d449f01ff38c6aba
Parent:     df619e6bafeb8e129aba3173d384544d7fa6e3c2
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:30:02 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:30:02 2008 +0100

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 arch/x86/kernel/i8253.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index a42c807..0f8f354 100644
--- a/arch/x86/kernel/i8253.c
+++ b/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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to