From owner-freebsd-arch Wed Aug 22 10:23: 5 2001 Delivered-To: freebsd-arch@freebsd.org Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by hub.freebsd.org (Postfix) with ESMTP id 8C47B37B40A for ; Wed, 22 Aug 2001 10:22:44 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92]) by tasogare.imasy.or.jp (8.11.3+3.4W/8.11.3/tasogare) with ESMTP/inet id f7MHMgI58039 for ; Thu, 23 Aug 2001 02:22:42 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) To: arch@FreeBSD.ORG Subject: CFR: Reenabling RTC interrupts after wakeup X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010823022240W.iwasaki@jp.FreeBSD.org> Date: Thu, 23 Aug 2001 02:22:40 +0900 From: Mitsuru IWASAKI X-Dispatcher: imput version 20000228(IM140) Lines: 68 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I've noticed that RTC interrupts never be generated on some machines after sleep/wakeup by ACPI. As a result, statclock() stops and system statistics monitoring tools (such as systat, vmstat...) may have problems. I think that this problem is not only with ACPI, but also with APM because I saw the same kind of reports before (in mobile@ ?). Here the fix for this, please review it. I'll commit this comming weekend if no objections. Thanks Index: include/clock.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/clock.h,v retrieving revision 1.39 diff -u -r1.39 clock.h --- include/clock.h 2000/10/15 09:51:48 1.39 +++ include/clock.h 2001/08/21 14:44:29 @@ -44,6 +44,7 @@ #endif int sysbeep __P((int pitch, int period)); void i8254_restore __P((void)); +void rtc_restore __P((void)); #endif /* _KERNEL */ Index: isa/clock.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/clock.c,v retrieving revision 1.174 diff -u -r1.174 clock.c --- isa/clock.c 2001/05/15 23:22:21 1.174 +++ isa/clock.c 2001/08/21 14:43:32 @@ -716,6 +716,17 @@ mtx_unlock_spin(&clock_lock); } +void +rtc_restore(void) +{ + + mtx_lock_spin(&clock_lock); + /* Reenable RTC updates and interrupts. */ + writertc(RTC_STATUSB, RTCSB_HALT | RTCSB_24HR); + writertc(RTC_STATUSB, rtc_statusb); + mtx_unlock_spin(&clock_lock); +} + /* * Initialize 8254 timer 0 early so that it can be used in DELAY(). * XXX initialization of other timers is unintentionally left blank. Index: isa/pmtimer.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/pmtimer.c,v retrieving revision 1.1 diff -u -r1.1 pmtimer.c --- isa/pmtimer.c 2000/09/14 22:34:57 1.1 +++ isa/pmtimer.c 2001/08/21 15:04:04 @@ -84,6 +84,7 @@ /* modified for adjkerntz */ pl = splsoftclock(); i8254_restore(); /* restore timer_freq and hz */ + rtc_restore(); /* reenable RTC interrupts */ inittodr(0); /* adjust time to RTC */ microtime(&resume_time); getmicrotime(&tmp_time); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message