Commit bdf800c4 authored by Stephen Boyd's avatar Stephen Boyd Committed by Russell King
Browse files

ARM: 7322/1: Print BUG instead of undefined instruction on BUG_ON()

The ARM kernel uses undefined instructions to implement
BUG/BUG_ON(). This leads to problems where people don't read one
line above the Oops message and see the "kernel BUG at ..."
message and so they wrongly assume the kernel has hit an
undefined instruction.

Instead of printing:

 Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP


 Internal error: Oops - BUG: 0 [#1] PREEMPT SMP

This should prevent people from thinking the BUG_ON was an
undefined instruction when it was actually intentional.
Signed-off-by: default avatarStephen Boyd <>
Acked-by: Simon Glass's avatarSimon Glass <>
Tested-by: Simon Glass's avatarSimon Glass <>
Signed-off-by: default avatarRussell King <>
parent b46c0f74
......@@ -266,6 +266,7 @@ void die(const char *str, struct pt_regs *regs, int err)
struct thread_info *thread = current_thread_info();
int ret;
enum bug_trap_type bug_type = BUG_TRAP_TYPE_NONE;
......@@ -273,7 +274,9 @@ void die(const char *str, struct pt_regs *regs, int err)
if (!user_mode(regs))
report_bug(regs->ARM_pc, regs);
bug_type = report_bug(regs->ARM_pc, regs);
if (bug_type != BUG_TRAP_TYPE_NONE)
str = "Oops - BUG";
ret = __die(str, err, thread, regs);
if (regs && kexec_should_crash(thread->task))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment