From: Frans Pop <elendil@planet.nl>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>
Subject: [patch] Document use of RTC in pm_trace
Date: Wed, 10 Sep 2008 20:07:08 +0200 [thread overview]
Message-ID: <200809102007.09670.elendil@planet.nl> (raw)
In-Reply-To: <alpine.LFD.1.10.0809101001360.3384@nehalem.linux-foundation.org>
On Wednesday 10 September 2008, Linus Torvalds wrote:
> On Wed, 10 Sep 2008, Frans Pop wrote:
> > But I would not expect the RTC to get changed when the resume is
> > successful. Or does it just get updated with every resume step
> > without a reset to the pre-trace value on completion?
>
> Indeed. We don't know where the bug happens when tracing, so each
> trace-point just writes its hash value into it. And nothing restores
> it, since nothing knows that the resume is "done" (a lot of problems
> happen due to X interactions much later than the 'core' resume thing).
Right. How about this patch then?
---
From: Frans Pop <elendil@planet.nl>
As pm_trace uses the system's hardware clock to save its magic
value, users of that option should be warned that using this debug
option will result in an incorrect system time after resume.
Signed-off-by: Frans Pop <elendil@planet.nl>
diff --git a/Documentation/power/s2ram.txt b/Documentation/power/s2ram.txt
index b05f512..2ebdc60 100644
--- a/Documentation/power/s2ram.txt
+++ b/Documentation/power/s2ram.txt
@@ -54,3 +54,21 @@ used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out
that "radeonfb" simply cannot resume that device - it tries to set the
PLL's, and it just _hangs_. Using the regular VGA console and letting X
resume it instead works fine.
+
+NOTE
+====
+pm_trace uses the system's Real Time Clock (RTC) to save the magic number.
+Reason for this is that the RTC is the only reliably available piece of
+hardware during resume operations where a value can be set that will
+survive a reboot.
+
+Consequence is that after a resume (even if it is successful) your system
+clock will have a value corresponding to the magic mumber instead of the
+correct date/time! It is therefore advisable to use a program like ntp-date
+or rdate to reset the correct date/time from an external time source when
+using this trace option.
+
+As the clock keeps ticking it is also essential that the reboot is done
+quickly after the resume failure. The trace option does not use the seconds
+or the low order bits of the minutes of the RTC, but a too long delay will
+corrupt the magic value.
next prev parent reply other threads:[~2008-09-10 18:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-10 14:58 Time travel experiment? Frans Pop
2008-09-10 14:29 ` Alan Cox
2008-09-10 15:55 ` Frans Pop
2008-09-10 16:25 ` Frans Pop
2008-09-10 16:56 ` Frans Pop
2008-09-10 17:02 ` Linus Torvalds
2008-09-10 18:07 ` Frans Pop [this message]
2008-09-13 11:20 ` [patch] Document use of RTC in pm_trace Pavel Machek
2008-09-10 21:28 ` Time travel experiment? Willy Tarreau
2008-09-10 20:47 ` Geert Uytterhoeven
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=200809102007.09670.elendil@planet.nl \
--to=elendil@planet.nl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--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