summaryrefslogtreecommitdiffstats
path: root/hrtimer-fix-wait-for-hrtimer.patch
blob: 0a69b34d84744e115fcc5bbfb06b6440b07a9561 (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
44
45
46
47
48
From 86e454cbe78acadda784bc6d4cdd7c6b4f5fe001 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 3 Jul 2009 08:44:30 -0500
Subject: [PATCH] hrtimer: fix wait for hrtimer

commit f6314be4567839f2850c48dcc7bedad4a5f798dc in tip.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 kernel/hrtimer.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 82efa41..93b2df2 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -908,7 +908,7 @@ void hrtimer_wait_for_timer(const struct hrtimer *timer)
 {
 	struct hrtimer_clock_base *base = timer->base;
 
-	if (base && base->cpu_base)
+	if (base && base->cpu_base && !hrtimer_hres_active(base->cpu_base))
 		wait_event(base->cpu_base->wait,
 				!(timer->state & HRTIMER_STATE_CALLBACK));
 }
@@ -955,8 +955,6 @@ static void __remove_hrtimer(struct hrtimer *timer,
 	rb_erase(&timer->node, &base->active);
 out:
 	timer->state = newstate;
-
-	wake_up_timer_waiters(base->cpu_base);
 }
 
 /*
@@ -1506,6 +1504,8 @@ void hrtimer_run_queues(void)
 		}
 		raw_spin_unlock(&cpu_base->lock);
 	}
+
+	wake_up_timer_waiters(cpu_base);
 }
 
 /*
-- 
1.7.0.4