* [PATCH] x86, apic: Clear APIC Timer Initial Count Register on shutdown
@ 2009-10-27 10:01 Andreas Herrmann
2009-10-27 14:00 ` [tip:x86/apic] " tip-bot for Andreas Herrmann
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Herrmann @ 2009-10-27 10:01 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin; +Cc: linux-kernel
Commit a98f8fd24fb24fcb9a359553e64dd6aac5cf4279 (x86: apic reset
counter on shutdown) set the counter to max to avoid spurious
interrupts when the timer is re-enabled.
(In theory) you'll still get a spurious interrupt if spending more
than 344 seconds with this interrupt disabled and then unmasking it.
The right thing to do is to clear the register. This disables the
interrupt from happening (at least it does on AMD hardware).
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
arch/x86/kernel/apic/apic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index dce93d4..4c689f4 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -444,7 +444,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);
+ apic_write(APIC_TMICT, 0);
break;
case CLOCK_EVT_MODE_RESUME:
/* Nothing to do here */
--
1.6.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:x86/apic] x86, apic: Clear APIC Timer Initial Count Register on shutdown
2009-10-27 10:01 [PATCH] x86, apic: Clear APIC Timer Initial Count Register on shutdown Andreas Herrmann
@ 2009-10-27 14:00 ` tip-bot for Andreas Herrmann
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Andreas Herrmann @ 2009-10-27 14:00 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, andreas.herrmann3, herrmann.der.user,
tglx, mingo
Commit-ID: 6f9b41006af1bc489030f84ee247abc0df1edccd
Gitweb: http://git.kernel.org/tip/6f9b41006af1bc489030f84ee247abc0df1edccd
Author: Andreas Herrmann <herrmann.der.user@googlemail.com>
AuthorDate: Tue, 27 Oct 2009 11:01:38 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 27 Oct 2009 14:54:21 +0100
x86, apic: Clear APIC Timer Initial Count Register on shutdown
Commit a98f8fd24fb24fcb9a359553e64dd6aac5cf4279 (x86: apic reset
counter on shutdown) set the counter to max to avoid spurious
interrupts when the timer is re-enabled.
(In theory) you'll still get a spurious interrupt if spending
more than 344 seconds with this interrupt disabled and then
unmasking it.
The right thing to do is to clear the register. This disables
the interrupt from happening (at least it does on AMD hardware).
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
LKML-Reference: <20091027100138.GB30802@alberich.amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/apic/apic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index dce93d4..4c689f4 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -444,7 +444,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);
+ apic_write(APIC_TMICT, 0);
break;
case CLOCK_EVT_MODE_RESUME:
/* Nothing to do here */
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-27 14:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-27 10:01 [PATCH] x86, apic: Clear APIC Timer Initial Count Register on shutdown Andreas Herrmann
2009-10-27 14:00 ` [tip:x86/apic] " tip-bot for Andreas Herrmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox