Re: pm_trace displays the wrong time from the RTC



On Tue, 31 Jul 2007 17:20:10 -0400 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--;


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.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: pm_trace displays the wrong time from the RTC
    ... That's this config option: ... bool "Suspend/resume event tracing" ... RTC across reboots, so that you can debug a machine that just hangs ... To use this debugging feature you should attempt to suspend the machine, ...
    (Linux-Kernel)
  • Re: [PATCH -mm] PM: Add pm_trace switch
    ... <grumbles about documentation> ... +the RTC across reboots, so that you can debug a machine that just hangs ... +during suspend ... Namely, the RTC is only ...
    (Linux-Kernel)
  • Re: [linux-usb-devel] [RFC] USB device persistence across suspend-to-disk
    ... Most PCs maintain the USB connections during suspend-to-RAM; ... +bus must continue to supply suspend current. ... people are forced to unmount any filesystems on a USB ... Would you prefer just a config option or a config option plus a module ...
    (Linux-Kernel)
  • Re: Suspending an Ultra 5/Solaris 8
    ... there was a power failure. ... but the sys-suspend command no longer works. ... >it generates an error dialog box with the message "Suspend is not ... >has persisted even after a couple complete reboots. ...
    (comp.unix.solaris)
  • Re: Small pm documentation cleanups
    ... You can suspend successfully, but you'll not be able to ... RTC across reboots, so that you can debug a machine that just hangs ... STD checkpoints the ... static int suspend_enter ...
    (Linux-Kernel)