lkml.org 
[lkml]   [2008]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC patch 0/4] TSC calibration improvements

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> However, this one is:
>
> > + /*
> > + * The iteration assumes that expect never goes below zero:
> > + */
> > + BUILD_BUG_ON(QUICK_PIT_ITERATIONS >= 0xff);
>
> No it doesn't. "expect" is unsigned char and will happily wrap, as
> will the PIT timer. The fact that it is in "single shot" mode doesn't
> actually mean that the timer stops, it just affects what happens when
> it goes down to zero.
>
> So that BUILD_BUG_ON() is misleading and incorrect.

ah, indeed, that bit of mine is wrong - and the period is programmed to
0xffff so it should all work out just fine. You code in a way too tricky
manner ;) I zapped that portion.

In fact ... shouldnt we intentionally include a 'wraparound' event in
the test? Some of the erratums/instabilities regarding PITs happened
around wraparounds [of the lsb] - maybe the wraparound of the MSB
matters too. (Maybe some boards freeze the counter readout until the
host OS ACKs the PIT irq or something - which we dont do in this
calibration run so if there's some weirdness there we'd detect it.)

So maybe we should start with an expect value of QUICK_PIT_ITERATIONS/2,
with a wraparound right in the middle of the measurement?

Ingo


\
 
 \ /
  Last update: 2008-09-04 23:25    [W:0.109 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site