aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2016-09-16 04:23:11 -0400
committerScott Wood <oss@buserror.net>2016-09-25 03:38:55 -0400
commite627f8dc9a6fb8c9fff371ab99cc36b4f4116433 (patch)
tree7395f7a124261933caede2ec50f282a27622a25f
parentf307939fb260c83e6875476695ac58a669348b8f (diff)
powerpc/8xx: add dedicated machine check handler
During a machine check, the 8xx provides indication of whether the check is due to data or instruction access, so let's display it. Lets also move 8xx specific handling into the new handler. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Scott Wood <oss@buserror.net>
-rw-r--r--arch/powerpc/include/asm/cputable.h1
-rw-r--r--arch/powerpc/kernel/cputable.c1
-rw-r--r--arch/powerpc/kernel/traps.c36
3 files changed, 27 insertions, 11 deletions
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index f752e6f7cfbe..ab68d0ee7725 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -43,6 +43,7 @@ extern int machine_check_e500mc(struct pt_regs *regs);
43extern int machine_check_e500(struct pt_regs *regs); 43extern int machine_check_e500(struct pt_regs *regs);
44extern int machine_check_e200(struct pt_regs *regs); 44extern int machine_check_e200(struct pt_regs *regs);
45extern int machine_check_47x(struct pt_regs *regs); 45extern int machine_check_47x(struct pt_regs *regs);
46int machine_check_8xx(struct pt_regs *regs);
46 47
47extern void cpu_down_flush_e500v2(void); 48extern void cpu_down_flush_e500v2(void);
48extern void cpu_down_flush_e500mc(void); 49extern void cpu_down_flush_e500mc(void);
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 6c4646ac9234..6a82ef039c50 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1248,6 +1248,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
1248 .mmu_features = MMU_FTR_TYPE_8xx, 1248 .mmu_features = MMU_FTR_TYPE_8xx,
1249 .icache_bsize = 16, 1249 .icache_bsize = 16,
1250 .dcache_bsize = 16, 1250 .dcache_bsize = 16,
1251 .machine_check = machine_check_8xx,
1251 .platform = "ppc823", 1252 .platform = "ppc823",
1252 }, 1253 },
1253#endif /* CONFIG_8xx */ 1254#endif /* CONFIG_8xx */
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 137b1371cce8..e493062937b0 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -667,6 +667,31 @@ int machine_check_e200(struct pt_regs *regs)
667 667
668 return 0; 668 return 0;
669} 669}
670#elif defined(CONFIG_PPC_8xx)
671int machine_check_8xx(struct pt_regs *regs)
672{
673 unsigned long reason = get_mc_reason(regs);
674
675 pr_err("Machine check in kernel mode.\n");
676 pr_err("Caused by (from SRR1=%lx): ", reason);
677 if (reason & 0x40000000)
678 pr_err("Fetch error at address %lx\n", regs->nip);
679 else
680 pr_err("Data access error at address %lx\n", regs->dar);
681
682#ifdef CONFIG_PCI
683 /* the qspan pci read routines can cause machine checks -- Cort
684 *
685 * yuck !!! that totally needs to go away ! There are better ways
686 * to deal with that than having a wart in the mcheck handler.
687 * -- BenH
688 */
689 bad_page_fault(regs, regs->dar, SIGBUS);
690 return 1;
691#else
692 return 0;
693#endif
694}
670#else 695#else
671int machine_check_generic(struct pt_regs *regs) 696int machine_check_generic(struct pt_regs *regs)
672{ 697{
@@ -726,17 +751,6 @@ void machine_check_exception(struct pt_regs *regs)
726 if (recover > 0) 751 if (recover > 0)
727 goto bail; 752 goto bail;
728 753
729#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
730 /* the qspan pci read routines can cause machine checks -- Cort
731 *
732 * yuck !!! that totally needs to go away ! There are better ways
733 * to deal with that than having a wart in the mcheck handler.
734 * -- BenH
735 */
736 bad_page_fault(regs, regs->dar, SIGBUS);
737 goto bail;
738#endif
739
740 if (debugger_fault_handler(regs)) 754 if (debugger_fault_handler(regs))
741 goto bail; 755 goto bail;
742 756