From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: ML ACPI-devel
<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: 2.6.9 S4: clock not updated after resume
Date: Thu, 21 Oct 2004 22:20:51 +0200 [thread overview]
Message-ID: <20041021202051.GA21624@elf.ucw.cz> (raw)
In-Reply-To: <4177A9DC.7060503-wlebWZzHoyE@public.gmane.org>
Hi!
> I use with success 'echo disk > /sys/power/state' on my ASUS M6N (BIOS
> 0210A), Debian /experimental/, vanilla 2.6.9, XFree86/GNOME, with all
> the modules installed (i.e, ALSA, bcm5700, ipw2100, USB, radeonfb, AGP/DRM).
>
> The resume is always ok, even if I suspend from battery or from AC,
> there're no problem at all. The only remark is that the internal clock
> is 'freezed' at the time I suspended the machine and I must re-update it
> using the NTP service. This is not so problematic if your machine is
> always connected to Internet, but as sometimes I work offline, I should
> re-update the internal clock by hand.
It is a bug, here's the fix.
Pavel
--- clean/arch/i386/kernel/time.c 2004-10-01 00:29:59.000000000 +0200
+++ linux/arch/i386/kernel/time.c 2004-10-19 15:16:14.000000000 +0200
@@ -319,7 +319,7 @@
return retval;
}
-static long clock_cmos_diff;
+static long clock_cmos_diff, sleep_start;
static int time_suspend(struct sys_device *dev, u32 state)
{
@@ -328,6 +328,7 @@
*/
clock_cmos_diff = -get_cmos_time();
clock_cmos_diff += get_seconds();
+ sleep_start = get_cmos_time();
return 0;
}
@@ -335,10 +336,13 @@
{
unsigned long flags;
unsigned long sec = get_cmos_time() + clock_cmos_diff;
+ unsigned long sleep_length = get_cmos_time() - sleep_start;
+
write_seqlock_irqsave(&xtime_lock, flags);
xtime.tv_sec = sec;
xtime.tv_nsec = 0;
write_sequnlock_irqrestore(&xtime_lock, flags);
+ jiffies += sleep_length * HZ;
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!
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
next prev parent reply other threads:[~2004-10-21 20:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-21 12:21 2.6.9 S4: clock not updated after resume Luca Capello
[not found] ` <4177A9DC.7060503-wlebWZzHoyE@public.gmane.org>
2004-10-21 20:20 ` Pavel Machek [this message]
[not found] ` <20041021202051.GA21624-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2004-10-22 8:10 ` Luca Capello
2004-10-23 15:03 ` Jon Valvatne
[not found] ` <loom.20041023T170041-953-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2004-10-23 17:49 ` Luca Capello
[not found] ` <417A99B4.40707-wlebWZzHoyE@public.gmane.org>
2004-10-26 20:01 ` Luca Capello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041021202051.GA21624@elf.ucw.cz \
--to=pavel-+zi9xunit7i@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox