fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc
PATCH v4 1/2 fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc
Signed-off-by Shaohui Xie <[email protected]>
Cc Li Yang <[email protected]>
Cc Kumar Gala <[email protected]>
Cc Roy Zang <[email protected]>
Cc Alexandre Bounine <[email protected]>
--- arch/powerpc/include/asm/rio.h | 5 +++++ arch/powerpc/kernel/traps.c | 13 +++++++++++++ arch/powerpc/sysdev/fsl_rio.c | 15 +++------------ 3 files changed, 21 insertions(+), 12 deletions(-)
arch/powerpc/include/asm/rio.h +5 -0
@@ -14,5 +14,10 @@#define ASM_PPC_RIO_H extern void platform_rio_init (void ); +#ifdef CONFIG_RAPIDIO +extern int fsl_rio_mcheck_exception (struct pt_regs *); +#else +static inline int fsl_rio_mcheck_exception (struct pt_regs *regs) {return 0 ; } +#endif #endif /* ASM_PPC_RIO_H */
arch/powerpc/kernel/traps.c +13 -0
@@ -55,6 +55,7 @@#endif #include <asm/kexec.h> #include <asm/ppc-opcode.h> +#include <asm/rio.h> #if defined(CONFIG_DEBUGGER ) || defined(CONFIG_KEXEC )int (*__debugger)(struct pt_regs *regs)__read_mostly ;
@@ -425,6 +426,12 @@ int machine_check_e500mc(struct pt_regs *regs)unsigned long reason = mcsr;int recoverable =1 ; +if (reason &MCSR_BUS_RBERR ) { + recoverable =fsl_rio_mcheck_exception (regs); +if (recoverable ==1 ) + goto silent_out; + } +printk ("Machine check in kernel mode.\n" );printk ("Caused by (from MCSR=%lx): " , reason);
@@ -500,6 +507,7 @@ int machine_check_e500mc(struct pt_regs *regs) reason & MCSR_MEA ? "Effective" : "Physical", addr); } +silent_out:mtspr (SPRN_MCSR , mcsr);return mfspr (SPRN_MCSR ) ==0 && recoverable; }
@@ -508,6 +516,11 @@ int machine_check_e500(struct pt_regs *regs) {unsigned long reason =get_mc_reason (regs); +if (reason &MCSR_BUS_RBERR ) { +if (fsl_rio_mcheck_exception (regs)) +return 1 ; + } +printk ("Machine check in kernel mode.\n" );printk ("Caused by (from MCSR=%lx): " , reason);
arch/powerpc/sysdev/fsl_rio.c +3 -12
@@ -260,9 +260,7 @@ struct rio_priv {static void __iomem *rio_regs_win;#ifdef CONFIG_E500 -static int (*saved_mcheck_exception)(struct pt_regs *regs); - -static int fsl_rio_mcheck_exception (struct pt_regs *regs) +int fsl_rio_mcheck_exception (struct pt_regs *regs) {const struct exception_table_entry *entry =NULL ;unsigned long reason =mfspr (SPRN_MCSR );
@@ -284,11 +282,9 @@ static int fsl_rio_mcheck_exception(struct pt_regs *regs) } } -if (saved_mcheck_exception) -return saved_mcheck_exception (regs); -else -return cur_cpu_spec->machine_check (regs); +return 0 ; } +EXPORT_SYMBOL_GPL (fsl_rio_mcheck_exception);#endif /**
@@ -1552,11 +1548,6 @@ int fsl_rio_setup(struct platform_device *dev)fsl_rio_doorbell_init (port);fsl_rio_port_write_init (port); -#ifdef CONFIG_E500 - saved_mcheck_exception = ppc_md.machine_check_exception; - ppc_md.machine_check_exception = fsl_rio_mcheck_exception; -#endif -return 0 ; err:iounmap (priv->regs_win);
Signature · 1 line
1.6.4
Tested on my 8548/RIO setup - works as expected.
Alex.
Quoted 5 lines
-----Original Message-----
From: Shaohui Xie [mailto:[email protected]]
Sent: Thursday, November 18, 2010 1:58 AM
To: [email protected]
Cc: [email protected]; Shaohui Xie; Li Yang; Kumar Gala; Roy
Zang; Bounine, Alexandre
Quoted 1 line
Subject: [PATCH 1/2][v4]
fsl_rio: movemachine_checkhandler into
machine_check_e500 &
Quoted 2 lines
machine_check_e500mc
=20
Kumar Gala
AppliedQuoted 10 lines · Shaohui Xie
Signed-off-by Shaohui Xie <[email protected]>Cc Li Yang <[email protected]>Cc Kumar Gala <[email protected]>Cc Roy Zang <[email protected]>Cc Alexandre Bounine <[email protected]>---
arch/powerpc/include/asm/rio.h | 5 +++++ arch/powerpc/kernel/traps.c | 13 +++++++++++++ arch/powerpc/sysdev/fsl_rio.c | 15 +++------------ 3 files changed, 21 insertions(+), 12 deletions(-)
applied to merge
- k