From: Yong Zhang Date: Wed, 20 Oct 2010 22:57:33 +0000 (-0700) Subject: timer: Warn when del_timer_sync() is called in hardirq context X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=466bd3030973910118ca601da8072be97a1e2209;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git timer: Warn when del_timer_sync() is called in hardirq context Add explict warning when del_timer_sync() is called in hardirq context. Signed-off-by: Yong Zhang Cc: Ingo Molnar Cc: Peter Zijlstra Acked-by: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Thomas Gleixner --- diff --git a/kernel/timer.c b/kernel/timer.c index 612de0306e79..483e54ba5c93 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -974,7 +974,11 @@ int del_timer_sync(struct timer_list *timer) lock_map_release(&timer->lockdep_map); local_bh_enable(); #endif - + /* + * don't use it in hardirq context, because it + * could lead to deadlock. + */ + WARN_ON(in_irq()); for (;;) { int ret = try_to_del_timer_sync(timer); if (ret >= 0)