Skip site navigation (1)Skip section navigation (2)
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
Message-ID:  <200004042238.PAA55218@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004042238.PAA55218>