mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Fabio Comolli <fabio.comolli@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <srostedt@redhat.com>,
	dsaxena@plexity.net, linux-kernel@vger.kernel.org,
	Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Subject: Re: TSC not updating after resume: Bug or Feature?
Date: Mon, 22 Dec 2008 15:48:36 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.0812221543550.3723@localhost.localdomain> (raw)
In-Reply-To: <b637ec0b0812211443u1ca9c11du5d61c41e3d82bc16@mail.gmail.com>

Fabio,

On Sun, 21 Dec 2008, Fabio Comolli wrote:
> Well, I'm the submitter of bug 12155 and I never had hpet=force on my
> command line. I don't know where you found it.
> Actually my command line is:

My bad. I confused it with the HPET force enable. (Your BIOS does not
advertise HPET).
 
> By the way, I don't know if it matters but the problema happened with
> in-kernel hibernation and also in out-of-tree TuxOnIce hibernation.
> Maybe this can help debugging the issue, I don't know.

Hmm, does not ring a bell here. Can you please apply the patch below
to mainline and retest ?

Thanks,

	tglx
-----
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index e8ab096..c18a6dd 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -86,6 +86,14 @@ void sched_clock_init(void)
 	sched_clock_running = 1;
 }
 
+void sched_clock_debug(void)
+{
+	struct sched_clock_data *scd = this_scd();
+
+	printk(KERN_INFO "SCD raw %llu gtod %llu clock %llu now %llu\n",
+	       scd->tick_raw, scd->tick_gtod, scd->clock, sched_clock());
+}
+
 /*
  * min,max except they take wrapping into account
  */
@@ -118,13 +126,13 @@ static u64 __update_sched_clock(struct sched_clock_data *scd, u64 now)
 
 	/*
 	 * scd->clock = clamp(scd->tick_gtod + delta,
-	 * 		      max(scd->tick_gtod, scd->clock),
-	 * 		      scd->tick_gtod + TICK_NSEC);
+	 *		      max(scd->tick_gtod, scd->clock),
+	 *		      max(scd->clock, scd->tick_gtod + TICK_NSEC));
 	 */
 
 	clock = scd->tick_gtod + delta;
 	min_clock = wrap_max(scd->tick_gtod, scd->clock);
-	max_clock = scd->tick_gtod + TICK_NSEC;
+	max_clock = wrap_max(scd->clock, scd->tick_gtod + TICK_NSEC);
 
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index fa05e88..bafbd2d 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -304,6 +304,8 @@ static int timekeeping_suspended;
 /* time in seconds when suspend began */
 static unsigned long timekeeping_suspend_time;
 
+extern void sched_clock_debug(void);
+
 /**
  * timekeeping_resume - Resumes the generic timekeeping subsystem.
  * @dev:	unused
@@ -336,6 +338,8 @@ static int timekeeping_resume(struct sys_device *dev)
 	timekeeping_suspended = 0;
 	write_sequnlock_irqrestore(&xtime_lock, flags);
 
+	sched_clock_debug();
+
 	touch_softlockup_watchdog();
 
 	clockevents_notify(CLOCK_EVT_NOTIFY_RESUME, NULL);
@@ -357,6 +361,8 @@ static int timekeeping_suspend(struct sys_device *dev, pm_message_t state)
 	timekeeping_suspended = 1;
 	write_sequnlock_irqrestore(&xtime_lock, flags);
 
+	sched_clock_debug();
+
 	clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
 
 	return 0;


  reply	other threads:[~2008-12-22 14:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-17 17:27 Deepak Saxena
2008-12-17 17:50 ` Steven Rostedt
2008-12-18  9:24   ` Peter Zijlstra
2008-12-18 12:39     ` Ingo Molnar
2008-12-18 22:19       ` Rafael J. Wysocki
2008-12-18 22:25         ` Dave Kleikamp
2008-12-18 23:39           ` Rafael J. Wysocki
2008-12-21 16:26         ` Thomas Gleixner
2008-12-21 19:43           ` Thomas Gleixner
2008-12-21 22:43             ` Fabio Comolli
2008-12-22 14:48               ` Thomas Gleixner [this message]
2008-12-22 15:00                 ` Ingo Molnar
2008-12-22 18:47                   ` Thomas Gleixner
2008-12-22 20:36                     ` Thomas Gleixner
2008-12-22 20:39                       ` Fabio Comolli
2008-12-22 21:13                         ` Thomas Gleixner
2008-12-22 21:35                           ` Fabio Comolli
2008-12-22 22:05                             ` Thomas Gleixner
2008-12-22 22:12                               ` Fabio Comolli
2008-12-22 22:16                                 ` Thomas Gleixner
2008-12-22 22:29                                   ` Fabio Comolli
2008-12-22 22:33                                     ` Thomas Gleixner
2008-12-23  0:28                                       ` Rafael J. Wysocki
2008-12-23 19:42                                       ` Fabio Comolli
2008-12-24 14:09                               ` Pavel Machek
2008-12-26  8:47                                 ` Peter Zijlstra
2008-12-22 20:19                 ` Fabio Comolli
2008-12-21 20:54           ` Thomas Gleixner
2008-12-23  0:47           ` Rafael J. Wysocki
2008-12-23  7:03             ` Thomas Gleixner
2008-12-23 14:15               ` Rafael J. Wysocki
2008-12-21 21:19 ` Thomas Gleixner
2008-12-23 22:03   ` Deepak Saxena

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.2.00.0812221543550.3723@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=dsaxena@plexity.net \
    --cc=fabio.comolli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rjw@sisk.pl \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=srostedt@redhat.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

all inboxes | Powered by JetHome®