Skip to content

Commit

Permalink
ARC: Show fault information passed to show_kernel_fault_diag()
Browse files Browse the repository at this point in the history
Currently we pass a string argument to show_kernel_fault_diag() which
describes the reason for the fault. This is not being used so just
add a pr_info() which outputs the fault information.

With this change we get from:

|
| Path: /bin/busybox
| CPU: 0 PID: 92 Comm: modprobe Not tainted 4.12.0-rc6 #30
| task: 9a254780 task.stack: 9a212000
|
| [ECR   ]: 0x00200400 => Other Fatal Err
|

to:

|
| Unhandled Machine Check Exception
| Path: /bin/busybox
| CPU: 0 PID: 92 Comm: modprobe Not tainted 4.12.0-rc6 #37
| task: 9a240780 task.stack: 9a226000
|
|[ECR   ]: 0x00200400 => Machine Check (Other Fatal Err)
|

Which can help debugging.

Cc: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
  • Loading branch information
joabreu authored and vineetgarc committed Sep 1, 2017
1 parent a518d63 commit aa7e3a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/arc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int do_misaligned_access(unsigned long address, struct pt_regs *regs,
*/
void do_machine_check_fault(unsigned long address, struct pt_regs *regs)
{
die("Machine Check Exception", regs, address);
die("Unhandled Machine Check Exception", regs, address);
}


Expand Down
5 changes: 4 additions & 1 deletion arch/arc/kernel/troubleshoot.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static void show_ecr_verbose(struct pt_regs *regs)
} else if (vec == ECR_V_ITLB_MISS) {
pr_cont("Insn could not be fetched\n");
} else if (vec == ECR_V_MACH_CHK) {
pr_cont("%s\n", (cause_code == 0x0) ?
pr_cont("Machine Check (%s)\n", (cause_code == 0x0) ?
"Double Fault" : "Other Fatal Err");

} else if (vec == ECR_V_PROTV) {
Expand Down Expand Up @@ -233,6 +233,9 @@ void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
{
current->thread.fault_address = address;

/* Show fault description */
pr_info("\n%s\n", str);

/* Caller and Callee regs */
show_regs(regs);

Expand Down

0 comments on commit aa7e3a5

Please sign in to comment.