Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Feb 2002 21:48:52 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Bruce Evans <bde@zeta.org.au>, freebsd-current@FreeBSD.ORG
Subject:   Re: Success! Sorta! (was Re: 'microuptime() went backwards ...' using ACPI timer. Shouldn't that be impossible? ) 
Message-ID:  <6432.1013978932@critter.freebsd.dk>
In-Reply-To: Your message of "Sun, 17 Feb 2002 12:42:54 PST." <200202172042.g1HKgs691210@apollo.backplane.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




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