[patch] high-res timers: resume fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Saturday, April 7, 2007 - 2:49 am

find updated patch below - only the patch description changed: i removed 
the 'UP' thing (patch has relevance on SMP too), and added Thomas' ack.

	Ingo

---------------------------->
Subject: [patch] high-res timers: resume fix
From: Ingo Molnar <mingo@elte.hu>

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.
Do the timer retrigger only on the current CPU.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/hrtimer.h |    3 +++
 kernel/hrtimer.c        |   12 ++++++++++++
 2 files changed, 15 insertions(+)

Index: linux/include/linux/hrtimer.h
===================================================================
--- linux.orig/include/linux/hrtimer.h
+++ linux/include/linux/hrtimer.h
@@ -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_tim
  */
 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: linux/kernel/hrtimer.c
===================================================================
--- linux.orig/kernel/hrtimer.c
+++ linux/kernel/hrtimer.c
@@ -459,6 +459,18 @@ void clock_was_set(void)
 }
 
 /*
+ * 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
  */
 static inline int hrtimer_cb_pending(const struct hrtimer *timer)
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.21-rc6, Linus Torvalds, (Thu Apr 5, 7:50 pm)
tg3: unable to handle null pointer dereference [Re: Linux ..., Nishanth Aravamudan, (Fri Apr 6, 2:40 pm)
Re: Linux 2.6.21-rc6 - regressions update, Soeren Sonnenburg, (Fri Apr 6, 3:44 pm)
Re: Linux 2.6.21-rc6 - regressions update, Linus Torvalds, (Fri Apr 6, 4:04 pm)
Re: tg3: unable to handle null pointer dereference, David Miller, (Fri Apr 6, 5:36 pm)
Re: tg3: unable to handle null pointer dereference, Nishanth Aravamudan, (Fri Apr 6, 6:53 pm)
[patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 1:12 am)
Re: [patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 1:25 am)
Re: Linux 2.6.21-rc6, Michal Piotrowski, (Sat Apr 7, 1:48 am)
Re: [patch] high-res timers: UP resume fix, Thomas Gleixner, (Sat Apr 7, 1:48 am)
Re: [patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 1:50 am)
Re: [patch] high-res timers: UP resume fix, Thomas Gleixner, (Sat Apr 7, 1:51 am)
Re: [patch] high-res timers: UP resume fix, Ingo Molnar, (Sat Apr 7, 2:47 am)
Re: [patch] high-res timers: UP resume fix, Rafael J. Wysocki, (Sat Apr 7, 2:48 am)
[patch] high-res timers: resume fix, Ingo Molnar, (Sat Apr 7, 2:49 am)
Re: [patch] high-res timers: UP resume fix, Thomas Gleixner, (Sat Apr 7, 2:51 am)
Re: [patch] high-res timers: UP resume fix, Rafael J. Wysocki, (Sat Apr 7, 2:53 am)
Re: [patch] high-res timers: resume fix, Rafael J. Wysocki, (Sat Apr 7, 3:02 am)
[patch, take #3] high-res timers: resume fix, Ingo Molnar, (Sat Apr 7, 3:05 am)
Re: [patch, take #3] high-res timers: resume fix, Soeren Sonnenburg, (Sat Apr 7, 3:45 am)
Re: Linux 2.6.21-rc6, Randy Dunlap, (Sat Apr 7, 11:37 am)
Re: Linux 2.6.21-rc6, Linus Torvalds, (Sat Apr 7, 11:46 am)
Re: Linux 2.6.21-rc6, Randy Dunlap, (Sat Apr 7, 11:50 am)
Re: Linux 2.6.21-rc6, Linus Torvalds, (Sat Apr 7, 11:51 am)
Re: Linux 2.6.21-rc6, Gene Heskett, (Sat Apr 7, 1:58 pm)
Re: Linux 2.6.21-rc6 - regressions update, Soeren Sonnenburg, (Sun Apr 8, 8:57 am)
Re: Linux 2.6.21-rc6, Andrew Morton, (Sun Apr 8, 4:09 pm)
Re: Linux 2.6.21-rc6, Greg KH, (Sun Apr 8, 5:42 pm)
Re: Linux 2.6.21-rc6, Jeff Garzik, (Sun Apr 8, 5:59 pm)
Re: Linux 2.6.21-rc6, Dmitry Torokhov, (Mon Apr 9, 8:32 pm)
Re: Linux 2.6.21-rc6, Chris Wedgwood, (Tue Apr 10, 12:57 am)
Re: Linux 2.6.21-rc6, Jeff Chua, (Tue Apr 10, 7:35 am)
Re: Linux 2.6.21-rc6, Linus Torvalds, (Tue Apr 10, 8:35 am)
Re: Linux 2.6.21-rc6, Ingo Molnar, (Wed Apr 11, 12:38 am)
Re: [patch] high-res timers: UP resume fix, Pavel Machek, (Wed Apr 11, 7:00 am)
Re: Linux 2.6.21-rc6, Jeff Chua, (Wed Apr 11, 9:16 pm)
Re: Linux 2.6.21-rc6, Mattia Dongili, (Thu Apr 12, 8:14 am)
Re: Linux 2.6.21-rc6, Mattia Dongili, (Thu Apr 12, 10:02 am)
Re: Linux 2.6.21-rc6, Maxim Levitsky, (Thu Apr 12, 11:26 am)
Re: Linux 2.6.21-rc6, Mattia Dongili, (Fri Apr 13, 1:52 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Fri Apr 13, 2:29 pm)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Fri Apr 13, 4:50 pm)
[1/3] 2.6.21-rc6: known regressions, Adrian Bunk, (Fri Apr 13, 5:36 pm)
[2/3] 2.6.21-rc6: known regressions, Adrian Bunk, (Fri Apr 13, 5:38 pm)
[3/3] 2.6.21-rc6: known regressions, Adrian Bunk, (Fri Apr 13, 5:38 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Fri Apr 13, 6:57 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Fri Apr 13, 11:50 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Tobias Doerffel, (Sat Apr 14, 12:24 am)
Re: [3/3] 2.6.21-rc6: known regressions, Dave Jones, (Sat Apr 14, 12:40 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 1:16 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 2:05 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 3:32 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 5:09 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 5:24 am)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Sat Apr 14, 5:26 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 5:31 am)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Sat Apr 14, 6:00 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 11:28 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 12:56 pm)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 1:23 pm)
Re: Linux 2.6.21-rc6, Adrian Bunk, (Sat Apr 14, 1:25 pm)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 1:38 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sat Apr 14, 2:35 pm)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sat Apr 14, 2:58 pm)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 12:38 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 1:02 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 4:16 am)
Re: Linux 2.6.21-rc6, Dmitry Torokhov, (Sun Apr 15, 7:19 am)
Re: [linux-pm] Linux 2.6.21-rc6, David Brownell, (Sun Apr 15, 8:14 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 8:52 am)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Sun Apr 15, 9:26 am)
Re: [linux-pm] Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 9:37 am)
Re: [3/3] 2.6.21-rc6: known regressions, Jeff Chua, (Sun Apr 15, 10:15 am)
Re: [linux-pm] Linux 2.6.21-rc6, David Brownell, (Sun Apr 15, 10:53 am)
Re: Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 11:50 am)
Re: Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 12:37 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Tobias Diedrich, (Sun Apr 15, 12:40 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Rafael J. Wysocki, (Sun Apr 15, 12:54 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Sun Apr 15, 4:08 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Sun Apr 15, 11:23 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Sun Apr 15, 11:45 pm)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Tue Apr 17, 1:17 am)
Re: [3/3] 2.6.21-rc6: known regressions, Antonino A. Daplas, (Tue Apr 17, 2:27 am)
Re: [3/3] 2.6.21-rc6: known regressions, Marcus Better, (Tue Apr 17, 4:54 am)
Re: [3/3] 2.6.21-rc6: known regressions, Pavel Machek, (Tue Apr 24, 8:33 am)
Re: [linux-pm] Linux 2.6.21-rc6, Tobias Diedrich, (Wed Apr 25, 10:14 am)
Re: [linux-pm] Linux 2.6.21-rc6, Rafael J. Wysocki, (Wed Apr 25, 12:36 pm)
Re: [linux-pm] Linux 2.6.21-rc6, Tobias Diedrich, (Wed Apr 25, 1:09 pm)