From owner-freebsd-i386@FreeBSD.ORG Fri Jan 11 21:10:02 2008 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4529F16A46C for ; Fri, 11 Jan 2008 21:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 22EC313C465 for ; Fri, 11 Jan 2008 21:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0BLA2ls097603 for ; Fri, 11 Jan 2008 21:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0BLA2ER097596; Fri, 11 Jan 2008 21:10:02 GMT (envelope-from gnats) Resent-Date: Fri, 11 Jan 2008 21:10:02 GMT Resent-Message-Id: <200801112110.m0BLA2ER097596@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Oliver B. Warzecha" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52D3116A418 for ; Fri, 11 Jan 2008 21:08:52 +0000 (UTC) (envelope-from obw@amarok.ping.de) Received: from lilly.ping.de (lilly.ping.de [83.97.42.2]) by mx1.freebsd.org (Postfix) with SMTP id D361E13C4CC for ; Fri, 11 Jan 2008 21:08:51 +0000 (UTC) (envelope-from obw@amarok.ping.de) Received: (qmail 16219 invoked by uid 10); 11 Jan 2008 20:42:09 -0000 Received: from amarok.ping.de by lilly.ping.de with UUCP (rmail-0.2-fdc); 11 Jan 2008 20:42:09 -0000 Received: from karnevil9.amarok.ping.de (localhost [127.0.0.1]) by karnevil9.amarok.ping.de (8.13.8/8.13.8) with ESMTP id m0BKWF3d001187 for ; Fri, 11 Jan 2008 21:32:15 +0100 (CET) (envelope-from obw@karnevil9.amarok.ping.de) Received: (from root@localhost) by karnevil9.amarok.ping.de (8.13.8/8.13.8/Submit) id m0BKWFXg001186; Fri, 11 Jan 2008 21:32:15 +0100 (CET) (envelope-from obw) Message-Id: <200801112032.m0BKWFXg001186@karnevil9.amarok.ping.de> Date: Fri, 11 Jan 2008 21:32:15 +0100 (CET) From: "Oliver B. Warzecha" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: i386/119574: 7.0-RC1 times out in calibrate_clocks() X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2008 21:10:02 -0000 >Number: 119574 >Category: i386 >Synopsis: 7.0-RC1 times out in calibrate_clocks() >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 11 21:10:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Oliver B. Warzecha >Release: FreeBSD 7.0-RC1 i386 >Organization: private >Environment: System: FreeBSD karnevil9.amarok.ping.de 7.0-RC1 GENERIC kernel from CD and self compiled hint.acpi.0.disabled="1" added to /boot/device.hints >Description: The 7.0-RC1 GENERIC kernel fails to recognize that the seconds counter changes during the loops in calibrate_clocks() in sys/i386/isa/clocks.c The same machine passes this routine quickly with 6.2-RELEASE-p8. It is a 200 MHz AMD K6 on an ASUS P55T2P4S board. Through generous use of debugging printf()'s while searching, I could limit the possible causes to this lines: timeout = 100000000; /* Read the mc146818A seconds counter. */ for (;;) { if (!(rtcin(RTC_STATUSA) & RTCSA_TUP)) { sec = rtcin(RTC_SEC); break; } if (--timeout == 0) goto fail; } // printf("seconds counter read ... \n"); /* Wait for the mC146818A seconds counter to change. */ start_sec = sec; for (;;) { if (!(rtcin(RTC_STATUSA) & RTCSA_TUP)) { sec = rtcin(RTC_SEC); if (sec != start_sec) break; } if (--timeout == 0) goto fail; } // printf("seconds counter changed ... \n"); (my debugging printf()s commented out with C++ comments) The first output "seconds counter read" gets printed very fast. After that the machine counts back from 0 to 0 and after some minutes he falls out of the loop and "seconds counter changed" gets never printed. As I noticed that rtcin() was reworked during the change to 7.0, (http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/isa/clock.c.diff?r1=1.222.2.2;r2=1.239.2.1;f=h) it occurred to me that perhaps there might be some condition in the new code. As I said, on a 6.2-RELEASE-p8 kernel it all goes smoothly, I just checked with boot -v: Calibrating clock(s) ... i8254 clock: 1193296 Hz CLK_USE_I8254_CALIBRATION not specified - using default frequency Timecounter "i8254" frequency 1193182 Hz quality 0 It does *not* say "failed, using default i8254 clock [...]" which would indicate the "fault" label. >How-To-Repeat: boot 7.0-RC1 GENERIC on the hardware mentioned above (tested it on one other machine with "no ACPI" from the the boot CD, but that one booted fast and recognized the timer) >Fix: One possible workaround would be to reset the timeout variable to a more sane value, for the first loop it gets set to 100000000. But then this loop seems to work okay, so I have no idea what a sane value would be. At least it would fail fast. For a complete fix I have no idea than to revert to the 6.2-code. But I think, this may be out of the question. >Release-Note: >Audit-Trail: >Unformatted: