x86: apic reset counter on shutdown
authorThomas Gleixner <tglx@linutronix.de>
Thu, 6 Nov 2008 00:13:39 +0000 (01:13 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 11 Nov 2008 13:56:55 +0000 (14:56 +0100)
Impact: avoid spurious lapic timer events on shutdown

The apic timer might be close to firing when it is shutdown. We can
not really disable the timer - we just mask the interrupt. That way we
can get an extra interrupt when it is reenabled. Set the counter to
max on shutdown to avoid this.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/apic.c

index 70879c9e393689bf9a97a24e67d6a12d7a6b3f02..1d410ee4b06467cd79fc25d083783419014585c4 100644 (file)
@@ -441,6 +441,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
                v = apic_read(APIC_LVTT);
                v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
                apic_write(APIC_LVTT, v);
+               apic_write(APIC_TMICT, 0xffffffff);
                break;
        case CLOCK_EVT_MODE_RESUME:
                /* Nothing to do here */