[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080904212130.GA12406@elte.hu>
Date: Thu, 4 Sep 2008 23:21:30 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Alan Cox <alan@...rguk.ukuu.org.uk>,
Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Alok Kataria <akataria@...are.com>,
Arjan van de Veen <arjan@...radead.org>,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [RFC patch 0/4] TSC calibration improvements
* Linus Torvalds <torvalds@...ux-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists