ARM: 5977/1: arm: Enable backtrace printing on oops when PC is corrupted

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>
This commit is contained in:
Laurent Pinchart 2010-03-04 15:33:16 +01:00 коммит произвёл Russell King
Родитель 1d40ddd10d
Коммит 51d47999b9
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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;