| From 7f985ea3e379046e01af6f37ebc9e0d83ca78e8e Mon Sep 17 00:00:00 2001 |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Fri, 3 Jul 2009 08:44:31 -0500 |
| Subject: [PATCH] hrtimer: fix reprogram thinko |
| |
| commit ea583cb09051aef3a1b2a770caa7e564e7042483 in tip. |
| |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| |
| diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c |
| index f22611d..05302de 100644 |
| --- a/kernel/hrtimer.c |
| +++ b/kernel/hrtimer.c |
| @@ -701,6 +701,9 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, |
| struct hrtimer_clock_base *base, |
| int wakeup) |
| { |
| +#ifdef CONFIG_PREEMPT_RT |
| +again: |
| +#endif |
| if (base->cpu_base->hres_active && hrtimer_reprogram(timer, base)) { |
| #ifdef CONFIG_PREEMPT_RT |
| /* |
| @@ -712,6 +715,12 @@ static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, |
| ktime_t now = ktime_get(); |
| |
| __run_hrtimer(timer, &now); |
| + /* |
| + * __run_hrtimer might have requeued timer and |
| + * it could be base->first again. |
| + */ |
| + if (base->first == &timer->node) |
| + goto again; |
| return 1; |
| } |
| #endif |
| -- |
| 1.7.1.1 |
| |