]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] high-res timers: resume fix
authorIngo Molnar <mingo@elte.hu>
Sat, 7 Apr 2007 10:05:00 +0000 (12:05 +0200)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 7 Apr 2007 17:03:43 +0000 (10:03 -0700)
Soeren Sonnenburg reported that upon resume he is getting
this backtrace:

 [<c0119637>] smp_apic_timer_interrupt+0x57/0x90
 [<c0142d30>] retrigger_next_event+0x0/0xb0
 [<c0104d30>] apic_timer_interrupt+0x28/0x30
 [<c0142d30>] retrigger_next_event+0x0/0xb0
 [<c0140068>] __kfifo_put+0x8/0x90
 [<c0130fe5>] on_each_cpu+0x35/0x60
 [<c0143538>] clock_was_set+0x18/0x20
 [<c0135cdc>] timekeeping_resume+0x7c/0xa0
 [<c02aabe1>] __sysdev_resume+0x11/0x80
 [<c02ab0c7>] sysdev_resume+0x47/0x80
 [<c02b0b05>] device_power_up+0x5/0x10

it turns out that on resume we mistakenly re-enable interrupts too
early.  Do the timer retrigger only on the current CPU.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Soeren Sonnenburg <kernel@nn7.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/hrtimer.h
kernel/hrtimer.c
kernel/timer.c

index 5bdbc744e773096dbcbdd49d12a81afe90beaa90..17c29dca8354d2e88e8b971b5b02d290713e8b8b 100644 (file)
@@ -206,6 +206,7 @@ struct hrtimer_cpu_base {
 struct clock_event_device;
 
 extern void clock_was_set(void);
+extern void hres_timers_resume(void);
 extern void hrtimer_interrupt(struct clock_event_device *dev);
 
 /*
@@ -236,6 +237,8 @@ static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer)
  */
 static inline void clock_was_set(void) { }
 
+static inline void hres_timers_resume(void) { }
+
 /*
  * In non high resolution mode the time reference is taken from
  * the base softirq time variable.
index 067ba2c0532805f8e9e3e753eba456d6a7cbf1b9..b74860aaf5f18713a2ff4c7a0719969bd86496fd 100644 (file)
@@ -458,6 +458,18 @@ void clock_was_set(void)
        on_each_cpu(retrigger_next_event, NULL, 0, 1);
 }
 
+/*
+ * During resume we might have to reprogram the high resolution timer
+ * interrupt (on the local CPU):
+ */
+void hres_timers_resume(void)
+{
+       WARN_ON_ONCE(num_online_cpus() > 1);
+
+       /* Retrigger the CPU local events: */
+       retrigger_next_event(NULL);
+}
+
 /*
  * Check, whether the timer is on the callback pending list
  */
index 440048acaea1b93ae686d1000d59df236d3d5ed9..dd6c2c1c561bf1ecc1e3bf162b33e8028de0c194 100644 (file)
@@ -1016,7 +1016,7 @@ static int timekeeping_resume(struct sys_device *dev)
        clockevents_notify(CLOCK_EVT_NOTIFY_RESUME, NULL);
 
        /* Resume hrtimers */
-       clock_was_set();
+       hres_timers_resume();
 
        return 0;
 }