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

Commit d2e952b8 authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa
Browse files

sched: convert WARN_ON() to printk_sched() in try_to_wake_up_local()



try_to_wake_up_local() is called with the rq lock held. Printing to
console in this context can result in a deadlock if klogd needs to
be woken up. Print to the kernel log buffer via printk_sched()
instead which avoids the wakeup.

Change-Id: Ia07baea3cb7e0b158545207fdbbb866203256d3c
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent fdc49c46
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1561,9 +1561,12 @@ static void try_to_wake_up_local(struct task_struct *p)
{
	struct rq *rq = task_rq(p);

	if (WARN_ON(rq != this_rq()) ||
	    WARN_ON(p == current))
	if (rq != this_rq() || p == current) {
		printk_sched("%s: Failed to wakeup task %d (%s), rq = %p, this_rq = %p, p = %p, current = %p\n",
			__func__, task_pid_nr(p), p->comm, rq,
			this_rq(), p, current);
		return;
	}

	lockdep_assert_held(&rq->lock);