[ltp] System clock wrong on resume from ACPI suspend in recent FC3 update

Thomas de Grenier de Latour linux-thinkpad@linux-thinkpad.org
Fri, 21 Jan 2005 20:17:29 +0100


--Multipart_Fri__21_Jan_2005_20_17_29_+0100_mqlm7Qu_h+FF=X90
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Fri, 21 Jan 2005 12:22:27 -0500
Eric Benson <eric_a_benson@yahoo.com> wrote:

> 
> Is this a known problem? Is there a fix?
> 

I'm not sure, but the attached patch may be the fix you're looking
for. You can apply it to your kernel sources tree, or try a
2.6.11-rc1 kernel since it comes from there.

-- 
TGL.

--Multipart_Fri__21_Jan_2005_20_17_29_+0100_mqlm7Qu_h+FF=X90
Content-Type: text/x-patch; name=S3_resume_-_time_too_fast_fix.patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename=S3_resume_-_time_too_fast_fix.patch

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/01/04 21:28:15-08:00 shaohua.li@intel.com 
#   [PATCH] time runx too fast after S3
#   
#   After resume from S3, 'date' shows time run too fast.
#   
#   Signed-off-by: Li Shaohua <shaohua.li@intel.com>
#   Signed-off-by: Andrew Morton <akpm@osdl.org>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
# 
# arch/i386/kernel/time.c
#   2005/01/04 18:48:13-08:00 shaohua.li@intel.com +3 -2
#   time runx too fast after S3
# 
diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c	2005-01-21 11:11:55 -08:00
+++ b/arch/i386/kernel/time.c	2005-01-21 11:11:55 -08:00
@@ -342,12 +342,13 @@
 		hpet_reenable();
 #endif
 	sec = get_cmos_time() + clock_cmos_diff;
-	sleep_length = get_cmos_time() - sleep_start;
+	sleep_length = (get_cmos_time() - sleep_start) * HZ;
 	write_seqlock_irqsave(&xtime_lock, flags);
 	xtime.tv_sec = sec;
 	xtime.tv_nsec = 0;
 	write_sequnlock_irqrestore(&xtime_lock, flags);
-	jiffies += sleep_length * HZ;
+	jiffies += sleep_length;
+	wall_jiffies += sleep_length;
 	return 0;
 }
 

--Multipart_Fri__21_Jan_2005_20_17_29_+0100_mqlm7Qu_h+FF=X90--