public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Chuck Ebbert <cebbert@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: pm_trace displays the wrong time from the RTC
Date: Tue, 31 Jul 2007 17:56:09 -0400	[thread overview]
Message-ID: <20070731215609.GB31045@redhat.com> (raw)
In-Reply-To: <20070731143939.774eb9db.randy.dunlap@oracle.com>

On Tue, Jul 31, 2007 at 02:39:39PM -0700, Randy Dunlap wrote:
 > On Tue, 31 Jul 2007 17:20:10 -0400 Chuck Ebbert wrote:

 > > include/asm-generic/rtc.h:
 > > 102         /*
 > > 103          * Account for differences between how the RTC uses the values
 > > 104          * and how they are defined in a struct rtc_time;
 > > 105          */
 > > 106         if (time->tm_year <= 69)
 > > 107                 time->tm_year += 100;
 > > 108 
 > > 109         time->tm_mon--;
 > 
 > 
 > That's this config option (read all of it):
 > 
 > config PM_TRACE
 > 	bool "Suspend/resume event tracing"
 > 	depends on PM_DEBUG && X86 && EXPERIMENTAL
 > 	default n
 > 	---help---
 > 	This enables some cheesy code to save the last PM event point in the
 > 	RTC across reboots, so that you can debug a machine that just hangs
 > 	during suspend (or more commonly, during resume).
 > 
 > 	To use this debugging feature you should attempt to suspend the machine,
 > 	then reboot it, then run
 > 
 > 		dmesg -s 1000000 | grep 'hash matches'
 > 
 > 	CAUTION: this option will cause your machine's real-time clock to be
 > 	set to an invalid time after a resume.

Doesn't this only take effect if you've been poking /sys/power/pm_trace though ?
Also, look at the date in the output from Chuck. It looks like only the
year is wrong.  I'd have expected more than just the century byte to have been
corrupted.

That +100 heuristic seems really odd to me.  Possibly it needs to be
checking if the century byte is set/unset, or it needs additional
clamping to make sure it doesn't overflow.

	Dave

-- 
http://www.codemonkey.org.uk

  reply	other threads:[~2007-07-31 21:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31 21:20 pm_trace displays the wrong time from the RTC Chuck Ebbert
2007-07-31 21:39 ` Randy Dunlap
2007-07-31 21:56   ` Dave Jones [this message]
2007-07-31 22:16     ` Randy Dunlap
2007-08-01 15:47 ` Rafael J. Wysocki
2007-08-01 15:54   ` Rafael J. Wysocki
2007-08-01 18:15   ` Chuck Ebbert
2007-08-01 19:50     ` Rafael J. Wysocki
2007-08-01 21:04     ` Rafael J. Wysocki
2007-10-17 19:48       ` Dave Jones
2007-10-17 20:35         ` Andrew Morton

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=20070731215609.GB31045@redhat.com \
    --to=davej@redhat.com \
    --cc=cebbert@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.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