Re: [2.6.10][Suspend] - Time problems

Pavel Machek
2005-01-12T22:54:21Z

Hi!

> > > When resuming from suspend, I noticed the clock is waay off (its 10:16pm,
> it
> > > shows 2:34AM EST time). This is even after a reboot the bios now shows
> wrong
> > > time?
> >
> > Yes, see for example thread "2.6.10-mm2: swsusp regression
> > [update]". Nigel has some patch that should fix it...
>
> Do you mean patches in the "[RFC] Patches to reduce delay in
> arch/kernel/time.c" thread?

I meant this one... (cut&pasted, apply by hand). But it seems to be
included in 2.6.11-rc1. I'm now confused.
Pavel

diff -ruNp 910-original-time-patch-old/arch/i386/kernel/time.c
910-original-time-patch-new/arch/i386/kernel/time.c
--- 910-original-time-patch-old/arch/i386/kernel/time.c 2004-12-27
+++ 910-original-time-patch-new/arch/i386/kernel/time.c 2005-01-08
@@ -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;
}

--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!