summaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/timers/timer_pm.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2005-09-03 15:57:07 -0700
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 00:06:18 -0700
commitc3c433e4f33afe255389ba3b1a003dc8deb3de9a (patch)
tree071304e15e21e0a93c17050000a682f4ae1a98c1 /arch/i386/kernel/timers/timer_pm.c
parent57c4ce3cbfba1bb0da7f37b9328a713cbd5d0919 (diff)
[PATCH] add suspend/resume for timer
The timers lack .suspend/.resume methods. Because of this, jiffies got a big compensation after a S3 resume. And then softlockup watchdog reports an oops. This occured with HPET enabled, but it's also possible for other timers. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/timers/timer_pm.c')
-rw-r--r--arch/i386/kernel/timers/timer_pm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/i386/kernel/timers/timer_pm.c b/arch/i386/kernel/timers/timer_pm.c
index 4ef20e66349..264edaaac31 100644
--- a/arch/i386/kernel/timers/timer_pm.c
+++ b/arch/i386/kernel/timers/timer_pm.c
@@ -186,6 +186,14 @@ static void mark_offset_pmtmr(void)
}
}
+static int pmtmr_resume(void)
+{
+ write_seqlock(&monotonic_lock);
+ /* Assume this is the last mark offset time */
+ offset_tick = read_pmtmr();
+ write_sequnlock(&monotonic_lock);
+ return 0;
+}
static unsigned long long monotonic_clock_pmtmr(void)
{
@@ -247,6 +255,7 @@ static struct timer_opts timer_pmtmr = {
.monotonic_clock = monotonic_clock_pmtmr,
.delay = delay_pmtmr,
.read_timer = read_timer_tsc,
+ .resume = pmtmr_resume,
};
struct init_timer_opts __initdata timer_pmtmr_init = {