diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-10-11 21:25:45 +0200 |
---|---|---|
committer | Arjan van de Ven <arjan@linux.intel.com> | 2008-10-11 21:25:45 +0200 |
commit | 030aebd2e439a2ebcca2b0ce30a02ed84feb043e (patch) | |
tree | 2a6e0ce9fbd690dd8d8be1b615dcedeaefffcc23 | |
parent | rangetimer: fix x86 build failure for the !HRTIMERS case (diff) | |
download | linux-030aebd2e439a2ebcca2b0ce30a02ed84feb043e.tar.xz linux-030aebd2e439a2ebcca2b0ce30a02ed84feb043e.zip |
rangetimer: fix BUG_ON reported by Ingo
There's a small race/chance that, while hrtimers are enabled globally,
they're later not enabled when we're calling the hrtimer_interrupt() function,
which then BUG_ON()'s for that. This patch closes that race/gap.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
-rw-r--r-- | kernel/hrtimer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index eb2cf984959f..b17657d8d81a 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1395,11 +1395,15 @@ void hrtimer_peek_ahead_timers(void) unsigned long flags; struct tick_device *td; struct clock_event_device *dev; - + struct hrtimer_cpu_base *cpu_base; if (hrtimer_hres_active()) return; local_irq_save(flags); + cpu_base = &__get_cpu_var(hrtimer_bases); + if (!cpu_base->hres_active) + goto out; + td = &__get_cpu_var(tick_cpu_device); if (!td) goto out; |