Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 466bd303 authored by Yong Zhang's avatar Yong Zhang Committed by Thomas Gleixner
Browse files

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: default avatarYong Zhang <yong.zhang0@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 1118e2cd
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -974,7 +974,11 @@ int del_timer_sync(struct timer_list *timer)
	lock_map_release(&timer->lockdep_map);
	lock_map_release(&timer->lockdep_map);
	local_bh_enable();
	local_bh_enable();
#endif
#endif

	/*
	 * don't use it in hardirq context, because it
	 * could lead to deadlock.
	 */
	WARN_ON(in_irq());
	for (;;) {
	for (;;) {
		int ret = try_to_del_timer_sync(timer);
		int ret = try_to_del_timer_sync(timer);
		if (ret >= 0)
		if (ret >= 0)