aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorYong Zhang <yong.zhang@windriver.com>2010-10-20 18:57:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-22 08:46:25 -0400
commit466bd3030973910118ca601da8072be97a1e2209 (patch)
tree70194e60d4054d045f35e29ee4fcd2230c2622dc /kernel
parent1118e2cd33d47254854e1ba3ba8e32802ff14fdf (diff)
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 <yong.zhang0@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Acked-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/timer.c6
1 files changed, 5 insertions, 1 deletions
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)
974 lock_map_release(&timer->lockdep_map); 974 lock_map_release(&timer->lockdep_map);
975 local_bh_enable(); 975 local_bh_enable();
976#endif 976#endif
977 977 /*
978 * don't use it in hardirq context, because it
979 * could lead to deadlock.
980 */
981 WARN_ON(in_irq());
978 for (;;) { 982 for (;;) {
979 int ret = try_to_del_timer_sync(timer); 983 int ret = try_to_del_timer_sync(timer);
980 if (ret >= 0) 984 if (ret >= 0)