ARM: 5977/1: arm: Enable backtrace printing on oops when PC is corrupted
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 4 Mar 2010 14:33:16 +0000 (15:33 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 7 Mar 2010 10:22:00 +0000 (10:22 +0000)
If PC points outside kernel text, start printing the backtrace at LR
instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/unwind.c

index 786ac2b6914ae4bc96cb3cb78dc6daa05127eee5..50292cd9c120aca1600c2bc2f8542697bc1bccca 100644 (file)
@@ -359,7 +359,9 @@ void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk)
                frame.fp = regs->ARM_fp;
                frame.sp = regs->ARM_sp;
                frame.lr = regs->ARM_lr;
-               frame.pc = regs->ARM_pc;
+               /* PC might be corrupted, use LR in that case. */
+               frame.pc = kernel_text_address(regs->ARM_pc)
+                        ? regs->ARM_pc : regs->ARM_lr;
        } else if (tsk == current) {
                frame.fp = (unsigned long)__builtin_frame_address(0);
                frame.sp = current_sp;