lkml.org 
[lkml]   [2005]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 5/7] 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>

Index: linux-2.6.13/arch/i386/kernel/time_hpet.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/time_hpet.c 2005-09-27 21:54:12.000000000 +0200
+++ linux-2.6.13/arch/i386/kernel/time_hpet.c 2005-09-27 21:56:38.000000000 +0200
@@ -319,8 +319,12 @@ static void hpet_rtc_timer_reinit(void)
{
unsigned int cfg, cnt;

- if (!(PIE_on | AIE_on | UIE_on))
+ if (unlikely(!(PIE_on | AIE_on | UIE_on))) {
+ cfg = hpet_readl(HPET_T1_CFG);
+ cfg &= ~HPET_TN_ENABLE;
+ hpet_writel(cfg, HPET_T1_CFG);
return;
+ }

if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
hpet_rtc_int_freq = PIE_freq;
Index: linux-2.6.13/arch/x86_64/kernel/time.c
===================================================================
--- linux-2.6.13.orig/arch/x86_64/kernel/time.c 2005-09-27 21:54:12.000000000 +0200
+++ linux-2.6.13/arch/x86_64/kernel/time.c 2005-09-27 21:57:27.000000000 +0200
@@ -1149,8 +1149,12 @@ static void hpet_rtc_timer_reinit(void)
{
unsigned int cfg, cnt;

- if (!(PIE_on | AIE_on | UIE_on))
+ if (unlikely(!(PIE_on | AIE_on | UIE_on))) {
+ cfg = hpet_readl(HPET_T1_CFG);
+ cfg &= ~HPET_TN_ENABLE;
+ hpet_writel(cfg, HPET_T1_CFG);
return;
+ }

if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
hpet_rtc_int_freq = PIE_freq;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-09-28 09:17    [W:1.470 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site