Skip to content

Commit

Permalink
ARM: 5977/1: arm: Enable backtrace printing on oops when PC is corrupted
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laurent Pinchart authored and Russell King committed Mar 7, 2010
1 parent 1d40ddd commit 51d4799
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/arm/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 51d4799

Please sign in to comment.