public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	David Brownell <david-b@pacbell.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Nigel Cunningham <nigel@nigel.suspend2.net>,
	Pavel Machek <pavel@ucw.cz>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: pm_trace displays the wrong time from the RTC
Date: Wed, 1 Aug 2007 23:04:34 +0200	[thread overview]
Message-ID: <200708012304.35105.rjw@sisk.pl> (raw)
In-Reply-To: <46B0CDB3.8060505@redhat.com>

On Wednesday, 1 August 2007 20:15, Chuck Ebbert wrote:
> On 08/01/2007 11:47 AM, Rafael J. Wysocki wrote:
> > Sorry for slow response, I've just noticed this thread.
> > 
> > On Tuesday, 31 July 2007 23:20, Chuck Ebbert wrote:
> >> When resuming, systems print this when booted on 07/31/07:
> >>
> >> Date: 06/31/107
> >>
> >> /drivers/base/power/trace.c::read_magic_time():
> >> 114	get_rtc_time(&time);
> >> 115	printk("Time: %2d:%02d:%02d Date: %02d/%02d/%02d\n",
> >> 116		time.tm_hour, time.tm_min, time.tm_sec,
> >> 117		time.tm_mon, time.tm_mday, time.tm_year);
> >>
> >> 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--;
> > 
> > Do you mean that systems display bad date after resuming if PM_TRACE is set,
> > even if /sys/power/pm_trace contains 1 ?

s/1/0/

> > If that's the case, are they i386 or x86_64?
> > 
> 
> i386:
> 
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=250238

OK, I think the appended patch is needed.

Greetings,
Rafael


---
The way in which read_magic_time() displays the date read from the RTC is
apparently confusing to the users
(cf. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=250238).  Make it
print dates in the standard way.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/base/power/trace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.23-rc1/drivers/base/power/trace.c
===================================================================
--- linux-2.6.23-rc1.orig/drivers/base/power/trace.c	2007-07-23 22:06:42.000000000 +0200
+++ linux-2.6.23-rc1/drivers/base/power/trace.c	2007-08-01 22:51:16.000000000 +0200
@@ -114,7 +114,7 @@ static unsigned int read_magic_time(void
 	get_rtc_time(&time);
 	printk("Time: %2d:%02d:%02d  Date: %02d/%02d/%02d\n",
 		time.tm_hour, time.tm_min, time.tm_sec,
-		time.tm_mon, time.tm_mday, time.tm_year);
+		time.tm_mon + 1, time.tm_mday, time.tm_year % 100);
 	val = time.tm_year;				/* 100 years */
 	if (val > 100)
 		val -= 100;

  parent reply	other threads:[~2007-08-01 20:56 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
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 [this message]
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=200708012304.35105.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    --cc=torvalds@linux-foundation.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