From: Thomas Gleixner <tglx@linutronix.de>
To: Alistair John Strachan <s0348365@sms.ed.ac.uk>
Cc: LKML <linux-kernel@vger.kernel.org>,
Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>,
john stultz <johnstul@us.ibm.com>, Ingo Molnar <mingo@elte.hu>,
Chris Wright <chrisw@sous-sol.org>,
Arjan van de Ven <arjan@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>, Andi Kleen <ak@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] x86-64 highres/dyntick support 2.6.22-rc1-v1
Date: Tue, 15 May 2007 00:05:14 +0200 [thread overview]
Message-ID: <1179180314.7074.36.camel@chaos> (raw)
In-Reply-To: <200705142215.08910.s0348365@sms.ed.ac.uk>
On Mon, 2007-05-14 at 22:15 +0100, Alistair John Strachan wrote:
> On Monday 14 May 2007 11:26:08 Thomas Gleixner wrote:
> > I'm pleased to announce an updated version of the x86_64 highres/dyntick
> > support patches against 2.6.22-rc1:
> [snip]
> > - Various fixups from Chris Wright
> > - TSC calibration fix (pointed out by Alistair John Strachan)
> >
> > Comments, bugreports, patches are welcome as ususal
>
> Neither of the bugs I reported appear to be fixed.
>
> I took a clean git tree from the 2.6.22-rc1 tag and patched with this version;
> my CPU MHz and dmesg counter still appear to be broken (v3 was used).
Sigh. /me feels stupid.
Can you please apply the following patch on top and check, whether it
fixes the problem ? Please provide the debug output, when it fails.
Thanks,
tglx
Index: linux-2.6.21/arch/x86_64/kernel/tsc.c
===================================================================
--- linux-2.6.21.orig/arch/x86_64/kernel/tsc.c
+++ linux-2.6.21/arch/x86_64/kernel/tsc.c
@@ -135,7 +135,7 @@ static unsigned long __init tsc_read_ref
for (i = 0; i < MAX_RETRIES; i++) {
t1 = get_cycles_sync();
if (hpet)
- *hpet = hpet_readl(HPET_COUNTER);
+ *hpet = hpet_readl(HPET_COUNTER) & 0xFFFFFFFF;
else
*pm = acpi_pm_read_early();
t2 = get_cycles_sync();
@@ -177,8 +177,10 @@ void __init tsc_calibrate(void)
tsc_khz = (tr2 - tr1) / 50;
/* hpet or pmtimer available ? */
- if (!hpet && !pm1 && !pm2)
+ if (!hpet && !pm1 && !pm2) {
+ printk(KERN_INFO "TSC calibrated against tick interrupt\n");
return;
+ }
/* Check, whether the sampling was disturbed by an SMI */
if (tsc1 == ULONG_MAX || tsc2 == ULONG_MAX) {
@@ -190,14 +192,25 @@ void __init tsc_calibrate(void)
tsc2 = (tsc2 - tsc1) * 1000000000L;
if (hpet) {
- hpet2 = (hpet2 - hpet1) & 0xFFFFFFFF;
+ printk(KERN_INFO "TSC calibrated against hpet %ld %ld",
+ hpet1, hpet2);
+ if (hpet2 < hpet1)
+ hpet2 += 0x100000000;
+ hpet2 -= hpet1;
tsc1 = (hpet2 * hpet_readl(HPET_PERIOD)) / 1000;
+ printk(" %lu %lu\n", hpet2, tsc1);
} else {
- pm2 = (pm2 -pm1) & ACPI_PM_MASK;
+ printk(KERN_INFO "TSC calibrated against pm_timer %ld %ld",
+ pm1, pm2);
+ if (pm2 < pm1)
+ pm2 += ACPI_PM_OVRRUN;
+ pm2 -= pm1;
tsc1 = (pm2 * PMTMR_TICKS_PER_SEC) / 1000;
+ printk(" %lu %lu\n", pm2, tsc1);
}
tsc_khz = tsc2 / tsc1;
+ printk(KERN_INFO "tsckhz: %lu %lu %u\n", tsc2, tsc1, tsc_khz);
}
/*
next prev parent reply other threads:[~2007-05-14 22:01 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-06 20:58 [PATCH] x86-64 highres/dyntick support Thomas Gleixner
2007-05-07 9:16 ` Nicolas Mailhot
2007-05-07 15:28 ` Thomas Gleixner
2007-05-08 17:08 ` Nicolas Mailhot
2007-05-07 16:31 ` Chris Wright
2007-05-07 16:46 ` Thomas Gleixner
2007-05-07 17:18 ` Chris Wright
2007-05-08 9:39 ` Chris Wright
2007-05-08 9:42 ` [PATCH 1/5] x86_64: tsc compile fix Chris Wright
2007-05-08 9:47 ` Thomas Gleixner
2007-05-08 9:43 ` [PATCH 2/5] x86_64: __setup_APIC_LVTT whitespace fix Chris Wright
2007-05-08 9:48 ` Thomas Gleixner
2007-05-08 9:44 ` [PATCH 3/5] i386: hpet assumes boot cpu is 0 Chris Wright
2007-05-08 9:54 ` Thomas Gleixner
2007-05-08 9:46 ` [PATCH 4/5] i386: i8253 clockevent shutdown and unused using pit Chris Wright
2007-05-08 9:53 ` Thomas Gleixner
2007-05-08 9:47 ` [PATCH 5/5] x86_64: restore restore nohpet cmdline Chris Wright
2007-05-08 9:53 ` Thomas Gleixner
2007-05-08 9:51 ` [PATCH] x86-64 highres/dyntick support Thomas Gleixner
2007-05-08 9:51 ` Chris Wright
2007-05-08 9:58 ` Thomas Gleixner
2007-05-08 10:06 ` Chris Wright
2007-05-08 10:34 ` Thomas Gleixner
2007-05-08 13:15 ` Pallipadi, Venkatesh
2007-05-07 22:43 ` Venki Pallipadi
2007-05-07 23:15 ` Thomas Gleixner
2007-05-14 1:17 ` Alistair John Strachan
2007-05-14 6:33 ` Thomas Gleixner
2007-05-14 10:26 ` [PATCH] x86-64 highres/dyntick support 2.6.22-rc1-v1 Thomas Gleixner
2007-05-14 20:10 ` Valdis.Kletnieks
2007-05-14 20:23 ` Thomas Gleixner
2007-05-14 21:15 ` Alistair John Strachan
2007-05-14 22:05 ` Thomas Gleixner [this message]
2007-05-14 22:42 ` Alistair John Strachan
2007-05-15 8:18 ` [PATCH] x86-64 highres/dyntick support 2.6.22-rc1-v4 Thomas Gleixner
2007-05-15 14:06 ` Frank Sorenson
2007-05-15 21:53 ` Thomas Gleixner
2007-05-15 23:20 ` Frank Sorenson
2007-05-16 5:02 ` Frank Sorenson
2007-05-16 6:20 ` Thomas Gleixner
2007-05-16 9:01 ` Thomas Gleixner
2007-05-15 23:23 ` Alistair John Strachan
2007-05-16 5:54 ` Thomas Gleixner
2007-05-16 10:03 ` [PATCH] x86-64 highres/dyntick support 2.6.22-rc1-v5 Thomas Gleixner
2007-05-16 19:48 ` Frank Sorenson
2007-05-17 4:25 ` Frank Sorenson
2007-05-17 19:12 ` Frank Sorenson
2007-05-17 19:19 ` Christoph Lameter
2007-05-18 3:55 ` Frank Sorenson
2007-05-18 16:58 ` Christoph Lameter
2007-05-18 19:44 ` Christoph Lameter
2007-05-17 22:09 ` [PATCH] x86-64 highres/dyntick support 2.6.22-rc1-v7 Thomas Gleixner
2007-05-21 1:14 ` Valdis.Kletnieks
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=1179180314.7074.36.camel@chaos \
--to=tglx@linutronix.de \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=chrisw@sous-sol.org \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=s0348365@sms.ed.ac.uk \
--cc=venkatesh.pallipadi@intel.com \
/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