sched: Fix __schedule_bug() output when called from an interrupt
If schedule is called from an interrupt handler __schedule_bug()
will call show_regs() with the registers saved during the
interrupt handling done in do_IRQ(). This means we'll see the
registers and the backtrace for the process that was interrupted
and not the full backtrace explaining who called schedule().
This is due to 838225b (sched: use show_regs() to improve
__schedule_bug() output, 2007-10-24) which improperly assumed
that get_irq_regs() would return the registers for the current
stack because it is being called from within an interrupt
handler. Simply remove the show_reg() code so that we dump a
backtrace for the interrupt handler that called schedule().
Change-Id: I2922e793bed4c2bf3f1e5d1be851c8d61a384fee
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/kernel/sched.c b/kernel/sched.c
index 1e633e6..f8289fc 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4149,8 +4149,6 @@
*/
static noinline void __schedule_bug(struct task_struct *prev)
{
- struct pt_regs *regs = get_irq_regs();
-
printk(KERN_ERR "BUG: scheduling while atomic: %s/%d/0x%08x\n",
prev->comm, prev->pid, preempt_count());
@@ -4158,11 +4156,7 @@
print_modules();
if (irqs_disabled())
print_irqtrace_events(prev);
-
- if (regs)
- show_regs(regs);
- else
- dump_stack();
+ dump_stack();
}
/*