Re: Time travel..


Subject: Re: Time travel..
From: Benjamin Herrenschmidt (benh@kernel.crashing.org)
Date: Fri Sep 21 2001 - 14:45:55 MDT


>> As I understand it (from work I was doing on IRQ blocking measurement)
>> *wrong* "timebase-frequency" properties were common in earlier Mac OF.
>>
>> AFAIK Linux does not rely on this properties (from what Ben H has told me).
>>
>> I can post some very simplistic user-space code to measure the TB frequency
>> (close enough) on the linux side if anyone wants it (basically doing the
>> same trick of calibrating it from gettimeofday).
>
>MOL contains such a user-space measurement, but it is only
>used if the timebase-frequency property is completely missing.
>Perhaps one should do the gettimeofday measurement and then
>compare with the OF property? I believe the OF value is
>better in most cases except when it is completely wrong.
>
>But... I would like to get a confirmation that it is
>the timebase-frequency which is the culprit.
>
>Btw, MacOS seems not to rely on the timebase-frequency either.
>It performs a calibration using the VIA timer (the linux kernel
>does this too).

I recently had to change the linux kernel in this regard, and may have to
do so again...

It appears that some machines have a valid timebase-frequency, and some
don't. On the other side, some machines' VIA timer is apparently badly
calibrated as well. For example, on the iBook 2 (the white one), the VIA
appears to be about 10% off, while the timabase-freq is correct.

I've changed recent kernels to use the device-tree value on "MacRISC2"
machines (most recent machines), but it appears not to be the solution as
some "QuickSilver" G4s are now experiencing important clock drifts. I
still have to figure out on which machines the device-tree can be
beleived and on which machines the VIA has to be used.

Regards,
Ben.



This archive was generated by hypermail 2a24 : Fri Sep 21 2001 - 13:56:40 MDT