summaryrefslogtreecommitdiffstats
path: root/hrtimer-fix-reprogram-thinko.patch
blob: 1d9175cbe5c6580384b5012e19fa3102650a9b22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 4df49c8c5996bb626c759e04c6a99e09cdf87583 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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 kernel/hrtimer.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

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.0.4