[patch] Document use of RTC in pm_trace

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Alan Cox <alan@...>, <linux-kernel@...>, Thomas Gleixner <tglx@...>
Date: Wednesday, September 10, 2008 - 2:07 pm

On Wednesday 10 September 2008, Linus Torvalds wrote:

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.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Time travel experiment?, Frans Pop, (Wed Sep 10, 10:58 am)
Re: Time travel experiment?, Alan Cox, (Wed Sep 10, 10:29 am)
Re: Time travel experiment?, Geert Uytterhoeven, (Wed Sep 10, 4:47 pm)
Re: Time travel experiment?, Frans Pop, (Wed Sep 10, 11:55 am)
Re: Time travel experiment?, Frans Pop, (Wed Sep 10, 12:25 pm)
Re: Time travel experiment?, Willy Tarreau, (Wed Sep 10, 5:28 pm)
Re: Time travel experiment?, Frans Pop, (Wed Sep 10, 12:56 pm)
Re: Time travel experiment?, Linus Torvalds, (Wed Sep 10, 1:02 pm)
[patch] Document use of RTC in pm_trace, Frans Pop, (Wed Sep 10, 2:07 pm)
Re: [patch] Document use of RTC in pm_trace, Pavel Machek, (Sat Sep 13, 7:20 am)