From 5daaea8f220befa71deab75f7a9a650afde34bd6 Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 3 Feb 2005 19:06:03 +0000 Subject: [PATCH] Anytime we write to the RTC's status B register to possibly enable interrupts, read from the interrupt status register to clear any pending interrupts. Otherwise in some rare cases the RTC would never fire any interrupts as it constantly thinks it has an interrupt pending. PR: i386/17800 PR: kern/76776 Submitted by: Jose M. Alcaide jose at we dot lc dot ehu dot es MFC after: 2 weeks --- sys/i386/isa/clock.c | 3 +++ sys/isa/atrtc.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index 1c82ffa90309..20763b251280 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -712,6 +712,7 @@ rtc_restore(void) writertc(RTC_STATUSB, RTCSB_24HR); writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); } /* @@ -911,6 +912,7 @@ resettodr() /* Reenable RTC updates and interrupts. */ writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); } @@ -957,6 +959,7 @@ cpu_initclocks() INTR_TYPE_CLK | INTR_FAST, NULL); writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); } init_TSC_tc(); diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 1c82ffa90309..20763b251280 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -712,6 +712,7 @@ rtc_restore(void) writertc(RTC_STATUSB, RTCSB_24HR); writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); } /* @@ -911,6 +912,7 @@ resettodr() /* Reenable RTC updates and interrupts. */ writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); } @@ -957,6 +959,7 @@ cpu_initclocks() INTR_TYPE_CLK | INTR_FAST, NULL); writertc(RTC_STATUSB, rtc_statusb); + rtcin(RTC_INTR); } init_TSC_tc();