LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Cc: Andrew Paprocki <andrew@ishiboo.com>,
	linux-kernel@vger.kernel.org, Balaji Rao <balajirrao@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	clemens@ladisch.de, venkatesh.pallipadi@intel.com,
	bob.picco@hp.com
Subject: Re: HPET timer broken using 2.6.23.13 / nanosleep() hangs
Date: Wed, 16 Jan 2008 15:15:01 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.0.99999.0801161458470.3764@localhost.localdomain> (raw)
In-Reply-To: <20080113140620.GA22507@linux.vnet.ibm.com>

On Sun, 13 Jan 2008, Dhaval Giani wrote:
> On Sun, Jan 13, 2008 at 08:10:46AM -0500, Andrew Paprocki wrote:
> > I applied the patch to my 2.6.23.13 tree and upon reboot it stopped right after:
> > 
> > Clocksource tsc unstable (delta = ... ns)
> > Time: hpet clocksource has been installed.
> > 
> > It locked up hard.. cursor stopped blinking and SysRq isn't working either.

The hint is in the original report:

Clocksource tsc unstable (delta = 500013666 ns)

That means, that the TSC was counting, but HPET not. So it looks like
the HPET readout is stale. Which explains, why after switching to HPET
clocksource the time system gets hosed.

I wonder why the HPET counter works check did not catch this.

Can you please apply the path below and provide the output ?

Thanks,

	tglx

Index: linux-2.6/arch/x86/kernel/hpet.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/hpet.c	2008-01-16 08:29:28.000000000 +0100
+++ linux-2.6/arch/x86/kernel/hpet.c	2008-01-16 15:13:19.000000000 +0100
@@ -323,7 +323,7 @@ static struct clocksource clocksource_hp
 static int hpet_clocksource_register(void)
 {
 	u64 tmp, start, now;
-	cycle_t t1;
+	cycle_t t1, t2;
 
 	/* Start the counter */
 	hpet_start_counter();
@@ -343,12 +343,17 @@ static int hpet_clocksource_register(voi
 		rdtscll(now);
 	} while ((now - start) < 200000UL);
 
-	if (t1 == read_hpet()) {
+	t2 = read_hpet();
+	if (t1 == t2) {
 		printk(KERN_WARNING
 		       "HPET counter not counting. HPET disabled\n");
 		return -ENODEV;
 	}
 
+	printk(KERN_INFO "HPET check: t1=%lu t2=%lu s=%lu n=%lu\n",
+	       (unsigned long) t1, (unsigned long) t2,
+	       (unsigned long) start, (unsigned long) now);
+
 	/* Initialize and register HPET clocksource
 	 *
 	 * hpet period is in femto seconds per cycle


  reply	other threads:[~2008-01-16 14:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-13 11:10 Andrew Paprocki
2008-01-13 12:03 ` Dhaval Giani
2008-01-13 13:10   ` Andrew Paprocki
2008-01-13 14:06     ` Dhaval Giani
2008-01-16 14:15       ` Thomas Gleixner [this message]
2008-01-16 14:28         ` Thomas Gleixner
2008-01-16 15:21           ` Thomas Gleixner
2008-01-16 19:39             ` Andrew Paprocki
2008-01-18 10:26               ` Thomas Gleixner
2008-02-09 23:27                 ` Andrew Paprocki
2008-01-14 12:59 ` Clemens Ladisch
2008-01-14 14:12   ` Balaji Rao

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=alpine.LFD.0.99999.0801161458470.3764@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=andrew@ishiboo.com \
    --cc=balajirrao@gmail.com \
    --cc=bob.picco@hp.com \
    --cc=clemens@ladisch.de \
    --cc=dhaval@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=venkatesh.pallipadi@intel.com \
    --subject='Re: HPET timer broken using 2.6.23.13 / nanosleep() hangs' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).