Created attachment 24759 [details] dmesg result First, either s2disk or s2ram works fine on my laptop (IBM x31 2672). I can suspend to disk, to ram without any difficulty. The problem is, after s2disk/s2ram, the system time will be reset unexpectedly. eg. ==================== # hwclock; /bin/echo disk >/sys/power/state; hwclock Thu 28 Jan 2010 04:44:12 PM CET -0.081849 seconds Sun 06 Apr 2036 02:54:01 AM CEST -0.179606 seconds ==================== =========== # hwclock;s2ram;hwclock Thu 28 Jan 2010 05:01:39 PM CET -0.007611 seconds Switching from vt7 to vt1 Calling radeon_cmd_light(0) Calling radeon_cmd_light(1) switching back to vt7 Sun 06 Apr 2036 03:02:01 AM CEST =========== I debug s2ram with echo, ========================== # hwclock ;echo mem > /sys/power/state; hwclock Thu 28 Jan 2010 05:03:49 PM CET -0.317434 seconds Sun 06 Apr 2036 02:54:01 AM CEST -0.455931 seconds =========================== Well, this can be solved by resync the hwclock after echo mem, hwclock ;echo mem > /sys/power/state; hwclock --systohc; hwclock Thu 28 Jan 2010 05:07:29 PM CET -0.181262 seconds Thu 28 Jan 2010 05:07:56 PM CET -0.499442 seconds ==================== but, until now, I can not find any method to solve this problem in s2disk. %%%%%%%%%%%%%%%%%%%% System Info %%%%%%%%%%%%%%%%%%%% # uname -r 2.6.31.5-0.1-default This is the kernel shipped with Opensuse 11.2, i have recompiled it with the default parameters after i changed the module: /usr/src/linux-2.6.31.5-0.1/drivers/media/dvb/dvb-usb/dibusb-common.c, but I have not tested s2ram/s2disk before i loaded the new module. But, I did all the test without my dvb-usb hardware, which means, the "dibusb-common" module is not loaded at all. # s2ram -i This machine can be identified by: sys_vendor = "IBM" sys_product = "2672KA1" sys_version = "ThinkPad X31" bios_version = "1QET97WW (3.02 )" =============================
By the way, If I switch off my laptop, then switch it on again, or I reboot the system, the hardware clock will not be changed at all. So, I think the problem lies in the step "echo men > /sys/power/state". But, I dont know what happend during this step.
What does 'date' show before/after suspend?
=================== Test I: I rebooted my laptop 10 Hours ago, use s2ram, 8 hours later, I wake it up, type the following command, and I waited for 4 mins before i switch on the laptop, so the date result is correct. But the hwclock result is set to year 1980. ============ # date;s2disk -r /dev/sda1;date Fri Jan 29 08:13:07 CET 2010 Fri Jan 29 08:17:26 CET 2010 ============ Test II: I reboot my laptop, and do the following test immediatly without starting any applications, the results are also correct: ============================== QY-X31:/home/qinyong # hwclock;date;s2disk -r /dev/sda1;date;hwclock Fri 29 Jan 2010 08:24:21 AM CET -0.800493 seconds Fri Jan 29 08:24:21 CET 2010 Fri Jan 29 08:25:14 CET 2010 Fri 29 Jan 2010 08:25:16 AM CET -0.849042 seconds QY-X31:/home/qinyong # hwclock Fri 29 Jan 2010 08:25:36 AM CET -0.961388 seconds QY-X31:/home/qinyong # hwclock;date;s2ram;hwclock;date Fri 29 Jan 2010 08:26:15 AM CET -0.093216 seconds Fri Jan 29 08:26:14 CET 2010 Switching from vt7 to vt1 Calling radeon_cmd_light(0) Calling radeon_cmd_light(1) switching back to vt7 Fri 29 Jan 2010 08:26:27 AM CET -0.892906 seconds Fri Jan 29 08:26:26 CET 2010 =============================== After my computer running for 7 hours(during this 7 hours, I used firefox,emacs,wvdial), I did the above test again: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Test III %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # date;hwclock ;s2ram ;date;hwclock Thu Jan 28 13:57:19 CET 2010 Thu 28 Jan 2010 01:57:20 PM CET -0.529556 seconds Switching from vt7 to vt1 Calling radeon_cmd_light(0) Calling radeon_cmd_light(1) switching back to vt7 Thu Jan 28 13:57:32 CET 2010 Sun 06 Apr 2036 02:54:01 AM CEST -0.448350 seconds ==================== Well, the date is correct, but the hwclock is changed. Then, I keep the hwclock value untouched, do a test hibernate on disk, ==================== %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Test IV %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # hwclock;date;s2disk -r /dev/sda1;hwclock;date Sun 06 Apr 2036 02:55:55 AM CEST -0.091799 seconds Thu Jan 28 13:59:27 CET 2010 Sun 06 Apr 2036 02:54:01 AM CEST -0.221551 seconds Thu Jan 28 13:59:35 CET 2010 ===================== the date value is correct, and hwclock value is unchanged. Then, I sync the hardware clock with my 'date' value, did the test again: ===================== %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Test V %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # hwclock;date;s2disk -r /dev/sda1;hwclock;date Thu 28 Jan 2010 02:01:34 PM CET -0.365166 seconds Thu Jan 28 14:01:34 CET 2010 Sun 06 Apr 2036 02:54:02 AM CEST -1.178611 seconds Sun Apr 6 03:54:38 CEST 2036 ===================== It's weird.
Do you have CONFIG_PM_TRACE set?
I checked my config file, yes, you are right, the CONFIG_PM_TRACE check box is checked. I will disable this option and try again. I hope this is the reason that makes my computer hardware clock changed. I will post the results when I finish my test. Thank you very much.
I have compiled my kernel without the option "CONFIG_PM_TRACE", until now, my laptop works fine, and hwclock is not changed at all. Thank you for your help. Since this is not the kernel bug, please close this bug report if necessory.
Closing.