public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]time run too fast after S3
@ 2004-11-22  9:15 Li Shaohua
  2004-11-22 18:33 ` john stultz
  0 siblings, 1 reply; 4+ messages in thread
From: Li Shaohua @ 2004-11-22  9:15 UTC (permalink / raw)
  To: lkml; +Cc: Andrew Morton, Pavel Machek

Hi,
after resume from S3, 'date' shows time run too fast. Here is a patch.

Thanks,
Shaohua

Signed-off-by: Li Shaohua <shaohua.li@intel.com>

diff -puN arch/i386/kernel/time.c~wall_jiffies arch/i386/kernel/time.c
--- 2.6/arch/i386/kernel/time.c~wall_jiffies	2004-11-22 17:04:42.720038352 +0800
+++ 2.6-root/arch/i386/kernel/time.c	2004-11-22 17:06:21.373040816 +0800
@@ -343,12 +343,13 @@ static int timer_resume(struct sys_devic
 		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;
 }
 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-23  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-22  9:15 [PATCH]time run too fast after S3 Li Shaohua
2004-11-22 18:33 ` john stultz
2004-11-22 18:54   ` George Anzinger
2004-11-22 21:45   ` Nigel Cunningham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox