aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-10-30 18:03:35 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:37:29 -0500
commitf00c96f313b07d2eb2845305b9a3395e14385767 (patch)
tree94efe251de277aca3faf81b0334eb1c7eb5ca956
parent0d29086177aaa1e7d14e6ebb7fc067b3ca6d5c11 (diff)
[PATCH] hpet-RTC: disable interrupt when no longer needed
When the emulated RTC interrupt is no longer needed, we better disable it; otherwise, we get a spurious interrupt whenever the timer has rolled over and reaches the same comparator value. Having a superfluous interrupt every five minutes doesn't hurt much, but it's bad style anyway. ;-) Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Acked-by: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/i386/kernel/time_hpet.c6
-rw-r--r--arch/x86_64/kernel/time.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c
index 658c0629ba6a..23e81fcbeaea 100644
--- a/arch/i386/kernel/time_hpet.c
+++ b/arch/i386/kernel/time_hpet.c
@@ -319,8 +319,12 @@ static void hpet_rtc_timer_reinit(void)
319{ 319{
320 unsigned int cfg, cnt; 320 unsigned int cfg, cnt;
321 321
322 if (!(PIE_on | AIE_on | UIE_on)) 322 if (unlikely(!(PIE_on | AIE_on | UIE_on))) {
323 cfg = hpet_readl(HPET_T1_CFG);
324 cfg &= ~HPET_TN_ENABLE;
325 hpet_writel(cfg, HPET_T1_CFG);
323 return; 326 return;
327 }
324 328
325 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) 329 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
326 hpet_rtc_int_freq = PIE_freq; 330 hpet_rtc_int_freq = PIE_freq;
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index bd5ea09bfdf9..7037ca668c63 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -1138,8 +1138,12 @@ static void hpet_rtc_timer_reinit(void)
1138{ 1138{
1139 unsigned int cfg, cnt; 1139 unsigned int cfg, cnt;
1140 1140
1141 if (!(PIE_on | AIE_on | UIE_on)) 1141 if (unlikely(!(PIE_on | AIE_on | UIE_on))) {
1142 cfg = hpet_readl(HPET_T1_CFG);
1143 cfg &= ~HPET_TN_ENABLE;
1144 hpet_writel(cfg, HPET_T1_CFG);
1142 return; 1145 return;
1146 }
1143 1147
1144 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ)) 1148 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
1145 hpet_rtc_int_freq = PIE_freq; 1149 hpet_rtc_int_freq = PIE_freq;