From owner-freebsd-current Sun Feb 17 12:52: 1 2002 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id 4272637B402 for ; Sun, 17 Feb 2002 12:51:56 -0800 (PST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.6/8.11.6) with ESMTP id g1HKmqN06434; Sun, 17 Feb 2002 21:48:52 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Matthew Dillon Cc: Bruce Evans , freebsd-current@FreeBSD.ORG Subject: Re: Success! Sorta! (was Re: 'microuptime() went backwards ...' using ACPI timer. Shouldn't that be impossible? ) In-Reply-To: Your message of "Sun, 17 Feb 2002 12:42:54 PST." <200202172042.g1HKgs691210@apollo.backplane.com> Date: Sun, 17 Feb 2002 21:48:52 +0100 Message-ID: <6432.1013978932@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <200202172042.g1HKgs691210@apollo.backplane.com>, Matthew Dillon wri tes: > Whoop! I take it back. I'm still getting the errors: > >microuptime() went backwards (458.168990 -> 458.168882) >microuptime() went backwards (578.609995 -> 577.929801) >microuptime() went backwards (748.912755 -> 748.237402) >microuptime() went backwards (775.159625 -> 775.159612) > > I also think this retry loop has to be done everywhere where the > timecounter structure is accessed directly. No, only where the timecounter hardware is read and the math done. As far as I know, this is the only place. As I said, I am far from convinced this is the solution to the problem we are looking at with the PIIX timecounter. Msmith has some magic code in sys/dev/acpi/acpi_timer.c which tries to identify if the PIIX counter is broken or OK and I notice that the mask seems to always be set to 24 bits even if the hardware is 32 bits. I am not sure I read his code right, but he seems to default to the unsafe method, can you try this copy&pasted patch ? Index: acpi_timer.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_timer.c,v retrieving revision 1.11 diff -u -r1.11 acpi_timer.c --- acpi_timer.c 8 Jan 2002 06:45:56 -0000 1.11 +++ acpi_timer.c 17 Feb 2002 20:48:23 -0000 @@ -138,7 +138,7 @@ if (getenv("debug.acpi.timer_test") != NULL) acpi_timer_test(); - acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; + acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; acpi_timer_timecounter.tc_frequency = acpi_timer_frequency; tc_init(&acpi_timer_timecounter); -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message