From: Ingo Molnar <mingo@elte.hu>
To: Florian Fainelli <florian.fainelli@telecomint.eu>
Cc: "john stultz" <johnstul@us.ibm.com>,
"Miklos Vajna" <vmiklos@frugalware.org>,
linux-kernel@vger.kernel.org,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
"Gabriel C" <nix.or.die@googlemail.com>,
"CSÉCSY László" <boobaa@frugalware.org>,
r.schwebel@pengutronix.de, sven@geggus.net
Subject: Re: System clock runs too fast after 2.6.27 -> 2.6.28.1 upgrade
Date: Sun, 25 Jan 2009 17:00:19 +0100 [thread overview]
Message-ID: <20090125160019.GA21455@elte.hu> (raw)
In-Reply-To: <200901251638.34040.florian.fainelli@telecomint.eu>
* Florian Fainelli <florian.fainelli@telecomint.eu> wrote:
> Le Sunday 25 January 2009 16:03:49 Ingo Molnar, vous avez écrit :
> > * Florian Fainelli <florian.fainelli@telecomint.eu> wrote:
> > > Le Saturday 24 January 2009 10:14:04 Ingo Molnar, vous avez écrit :
> > > > * john stultz <johnstul@us.ibm.com> wrote:
> > > > > On Fri, Jan 23, 2009 at 3:04 AM, Ingo Molnar <mingo@elte.hu> wrote:
> > > > > > * john stultz <johnstul@us.ibm.com> wrote:
> > > > > >> I'd think this would ideally be more of a subarch in the config
> > > > > >> selection like the AMD Elan is, so folks know it really is not
> > > > > >> just a extra-support feature and in fact limits what hardware you
> > > > > >> can use the resulting kernel on.
> > > > > >
> > > > > > a better solution is that if RDC is set [it is unset by default] we
> > > > > > should turn PIT_TICK_RATE into a variable, defaulting it to
> > > > > > 1193182. If a real RDC or ELAN system is running, that variable is
> > > > > > changed during early bootup, in the init functions for those
> > > > > > platforms.
> > > > >
> > > > > Took a quick look at this, and I don't see any detection code for
> > > > > either RDC. The X86_ELAN config also has no conditionals, but maybe
> > > > > the elan cpufreq code can help here.
> > > >
> > > > i'd suggest to just remove the #ifdef for now (it's causing problems)
> > > > and add the variable - we can add the quirks for those two platforms
> > > > later on, separately from your patch(es).
> > >
> > > Fine with me. Ingo, is there any infrastructure yet to get an early
> > > quirk set the PIT tick rate accordingly ?
> >
> > Not yet but it should be easy - do you have the time to implement it?
>
> Not until a week, sorry.
ok - i've done the interim patch below. Please send a quirk patch for
RDC's non-standard PIT frequency.
Ingo
------------------->
>From e1b4d1143651fb3838be1117785b6e0386fa151f Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Sun, 25 Jan 2009 16:57:00 +0100
Subject: [PATCH] x86: use standard PIT frequency
the RDC and ELAN platforms use slighly different PIT clocks, resulting in
a timex.h hack that changes PIT_TICK_RATE during build time. But if a
tester enables any of these platform support .config options, the PIT
will be miscalibrated on standard PC platforms.
So use one frequency - in a subsequent patch we'll add a quirk to allow
x86 platforms to define different PIT frequencies.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/include/asm/timex.h | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/arch/x86/include/asm/timex.h b/arch/x86/include/asm/timex.h
index 1287dc1..b5c9d45 100644
--- a/arch/x86/include/asm/timex.h
+++ b/arch/x86/include/asm/timex.h
@@ -1,18 +1,13 @@
-/* x86 architecture timex specifications */
#ifndef _ASM_X86_TIMEX_H
#define _ASM_X86_TIMEX_H
#include <asm/processor.h>
#include <asm/tsc.h>
-#ifdef CONFIG_X86_ELAN
-# define PIT_TICK_RATE 1189200 /* AMD Elan has different frequency! */
-#elif defined(CONFIG_X86_RDC321X)
-# define PIT_TICK_RATE 1041667 /* Underlying HZ for R8610 */
-#else
-# define PIT_TICK_RATE 1193182 /* Underlying HZ */
-#endif
-#define CLOCK_TICK_RATE PIT_TICK_RATE
+/* The PIT ticks at this frequency (in HZ): */
+#define PIT_TICK_RATE 1193182
+
+#define CLOCK_TICK_RATE PIT_TICK_RATE
#define ARCH_HAS_READ_CURRENT_TIMER
next prev parent reply other threads:[~2009-01-25 16:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 17:14 System clock runs too fast after 2.6.27 -> 2.6.28.1 upgrade Miklos Vajna
2009-01-21 20:00 ` john stultz
2009-01-21 21:07 ` Miklos Vajna
2009-01-21 21:34 ` john stultz
2009-01-22 19:51 ` Miklos Vajna
2009-01-22 19:55 ` Ingo Molnar
2009-01-23 0:12 ` Miklos Vajna
2009-01-22 20:03 ` john stultz
2009-01-22 23:57 ` Miklos Vajna
2009-01-23 1:43 ` john stultz
2009-01-23 11:04 ` Ingo Molnar
2009-01-24 1:36 ` john stultz
2009-01-24 9:14 ` Ingo Molnar
2009-01-25 11:18 ` Florian Fainelli
2009-01-25 15:03 ` Ingo Molnar
2009-01-25 15:38 ` Florian Fainelli
2009-01-25 16:00 ` Ingo Molnar [this message]
2009-01-25 11:17 ` Florian Fainelli
2009-01-25 15:02 ` Ingo Molnar
2009-01-25 14:59 ` Robert Schwebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090125160019.GA21455@elte.hu \
--to=mingo@elte.hu \
--cc=boobaa@frugalware.org \
--cc=florian.fainelli@telecomint.eu \
--cc=hpa@zytor.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nix.or.die@googlemail.com \
--cc=r.schwebel@pengutronix.de \
--cc=rjw@sisk.pl \
--cc=sven@geggus.net \
--cc=tglx@linutronix.de \
--cc=vmiklos@frugalware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox