]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
rangetimer: fix BUG_ON reported by Ingo
authorArjan van de Ven <arjan@linux.intel.com>
Sat, 11 Oct 2008 19:25:45 +0000 (12:25 -0700)
committerArjan van de Ven <arjan@linux.intel.com>
Sat, 11 Oct 2008 19:25:45 +0000 (12:25 -0700)
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>
kernel/hrtimer.c

index eb2cf984959fe154a8c3cdd07129227a95bc6e31..b17657d8d81aca4913a6e1d8cdbfa6885ab9dddd 100644 (file)
@@ -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;