From owner-freebsd-bugs Tue Apr 4 15:40: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 21A3437B8CC for ; Tue, 4 Apr 2000 15:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA55393; Tue, 4 Apr 2000 15:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 2F30B37B5AC for ; Tue, 4 Apr 2000 15:38:40 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA55218; Tue, 4 Apr 2000 15:38:40 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Message-Id: <200004042238.PAA55218@freefall.freebsd.org> Date: Tue, 4 Apr 2000 15:38:40 -0700 (PDT) From: jose@we.lc.ehu.es To: freebsd-gnats-submit@FreeBSD.org Subject: i386/17800: [PATCH] problem with statclock initialization Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 17800 >Category: i386 >Synopsis: [PATCH] problem with statclock initialization >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 4 15:40:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Jose M. Alcaide >Release: 3.4, 4.0, -CURRENT :-) >Organization: Universidad del Pais Vasco - Dept. de Electricidad y Electronica >Environment: FreeBSD v-ger.we.lc.ehu.es 3.4-RELEASE FreeBSD 3.4-RELEASE #0: Tue Apr 4 23:53:52 CEST 2000 root@v-ger.we.lc.ehu.es:/usr/src/sys/compile/V-GER i386 >Description: I found that the RTC does not generate statclock interrupts on a Dell Inspiron 3700 laptop under some circumstances (after rebooting while connected to AC power). Probably the BIOS fiddles the MC146818A in such a way that an interrupt is pending when the kernel initializes the system clocks. The routine cpu_initclocks() should ensure that there are no RTC interrupts pending before enabling IRQ8 in the ICU. This can be easily accomplished simply reading the RTC_INTR register. I tested this solution on my I3.7k laptop, and now the statclock always works. Maybe other laptops are affected by the same problem. >How-To-Repeat: Install FreeBSD 3.x, 4.0-STABLE or 5.0-CURRENT on a Dell Inspiron 3700 :-) Be sure that apm(4)'s 0x20 flag is _not_ set. Reboot with shutdown -r (warm boot). Type "vmstat -i" or "systat -vmstat". >Fix: The following patch (against 4.0-RELEASE's clock.c, but I think it is applicable to -CURRENT) does the trick: --------------------------- CUT HERE -------------------------- --- sys/i386/isa/clock.c.orig Tue Jan 4 23:24:59 2000 +++ sys/i386/isa/clock.c Wed Apr 5 00:04:45 2000 @@ -1022,6 +1022,7 @@ /* Initialize RTC. */ writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, RTCSB_24HR); + rtcin(RTC_INTR); /* clear any pending interrupt */ /* Don't bother enabling the statistics clock. */ if (statclock_disable) --------------------------- CUT HERE -------------------------- >Release-Note: >Audit-Trail: >Unformatted: X-Send-Pr-Version: www-1.0 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message