Commit 9dceefe483d7640ba0bbf3e53d1db880e7469aba

Authored by Shuah Khan
Committed by Rafael J. Wysocki
1 parent f5ce157210

PM / Sleep: Warn about system time after resume with pm_trace

pm_trace uses the system's Real Time Clock (RTC) to save the magic
number.  The 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 number
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.

There is no run-time message to warn users of the consequences of
enabling pm_trace.  Adding a warning message to pm_trace_store()
will serve as a reminder to users to set the system date and time
after resume.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff

... ... @@ -530,6 +530,10 @@
530 530  
531 531 if (sscanf(buf, "%d", &val) == 1) {
532 532 pm_trace_enabled = !!val;
  533 + if (pm_trace_enabled) {
  534 + pr_warn("PM: Enabling pm_trace changes system date and time during resume.\n"
  535 + "PM: Correct system time has to be restored manually after resume.\n");
  536 + }
533 537 return n;
534 538 }
535 539 return -EINVAL;