[PATCH] highres: warn on softirq handling an unsafe callback

From: Andres Salomon
Date: Mon Mar 05 2007 - 05:02:32 EST


run_hrtimer_queue is called from a softirq context, and should never run
a callback that is classified as HRTIMER_CB_IRQSAFE_NO_SOFTIRQ. A bug
in unrelated code had managed to trigger that bug, so let's add an
explicit warning to this function.

Signed-off-by: Andres Salomon <dilinger@xxxxxxxxxx>
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 476cb0c..167c296 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1130,6 +1130,7 @@ static inline void run_hrtimer_queue(struct hrtimer_cpu_base *cpu_base,
if (base->softirq_time.tv64 <= timer->expires.tv64)
break;

+ WARN_ON_ONCE(timer->cb_mode == HRTIMER_CB_IRQSAFE_NO_SOFTIRQ);
timer_stats_account_hrtimer(timer);

fn = timer->function;