| From 532e27fc838accbe6725986dc34fe4d555247817 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> |
| |
| 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.1.1 |
| |