From nobody@FreeBSD.org  Thu Jan 27 23:53:58 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7651016A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 27 Jan 2005 23:53:58 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 35E2843D3F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 27 Jan 2005 23:53:58 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0RNrvos040905
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 27 Jan 2005 23:53:57 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j0RNrvuR040904;
	Thu, 27 Jan 2005 23:53:57 GMT
	(envelope-from nobody)
Message-Id: <200501272353.j0RNrvuR040904@www.freebsd.org>
Date: Thu, 27 Jan 2005 23:53:57 GMT
From: Christian Staudenmayer <christian.staudenmayer@informatik.uni-ulm.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] ``top'' not working correctly on the Tyan S2510 (ThunderLE) mainboard
X-Send-Pr-Version: www-2.3

>Number:         76776
>Category:       kern
>Synopsis:       [PATCH] ``top'' not working correctly on the Tyan S2510 (ThunderLE) mainboard
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 28 00:00:37 GMT 2005
>Closed-Date:    Thu Feb 03 19:07:08 GMT 2005
>Last-Modified:  Thu Feb 03 19:07:08 GMT 2005
>Originator:     Christian Staudenmayer
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
University of Ulm, Germany
>Environment:
System: FreeBSD satan.lan 5.3-STABLE FreeBSD 5.3-STABLE #0: Wed Jan 26 00:35:03 CET 2005 root@satan.lan:/usr/src/sys/i386/compile/SMP i386

Hardware: 2x P3 Coppermine (933/256/133), 896 MB reg. ECC PC133 RAM, Tyan S2510 (ThunderLE) Mainboard
      
>Description:
The ``top'' program showed ``0.00%'' for all CPU states, including ``idle''. This was most of the time the case, but not always. I posted about this on a forum on the internet and someone replied telling me that this was apparently the case with some Tyan mainboards and that he had a patch for it. I used the patch and it worked. I do not know who it was who authored the patch, but since it's only one line and I really do want the problem fixed, I hereby submit it myself.
I encountered the problem on 5.3-RELEASE, 5.3-STABLE as well as 6.0-CURRENT. I'm running the provided ``SMP'' kernel configuration, however the problem persisted when running the stock kernel ``GENERIC'', even with only one CPU installed.
      
>How-To-Repeat:
I guess it depends on the specific piece of hardware used (the mainboard). Type in ``top'' and take a look at the percentages of CPU states (idle, nice, etc.).      
>Fix:
The patch provided below worked for me on 5.3-STABLE.
Again: I'm _not_ the author of this patch, but since it's only one line, I guess (hope) it doesn't matter.

--- patch.txt begins here ---
--- sys/i386/isa/clock.c.orig   Mon Jul 12 02:50:59 2004
+++ sys/i386/isa/clock.c        Thu Jan  6 21:13:48 2005
@@ -946,6 +946,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) {
--- patch.txt ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jhb 
Responsible-Changed-By: rwatson 
Responsible-Changed-When: Fri Jan 28 10:57:42 GMT 2005 
Responsible-Changed-Why:  
Chown to jhb since he has his hands well and truly muddied in the 
interrupt code.  If not, I guess we try phk or imp. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=76776 
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Thu Feb 3 19:06:45 GMT 2005 
State-Changed-Why:  
Duplicate of 17800, which has just been committed and will be MFC'd in a 
few weeks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76776 
>Unformatted:
