diff options
Diffstat (limited to 'arch/powerpc/sysdev/fsl_rio.c')
| -rw-r--r-- | arch/powerpc/sysdev/fsl_rio.c | 37 | 
1 files changed, 19 insertions, 18 deletions
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index 5b206a2fe17c..2de8551df40f 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c @@ -283,23 +283,24 @@ static void __iomem *rio_regs_win;  #ifdef CONFIG_E500  int fsl_rio_mcheck_exception(struct pt_regs *regs)  { -	const struct exception_table_entry *entry = NULL; -	unsigned long reason = mfspr(SPRN_MCSR); - -	if (reason & MCSR_BUS_RBERR) { -		reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR)); -		if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) { -			/* Check if we are prepared to handle this fault */ -			entry = search_exception_tables(regs->nip); -			if (entry) { -				pr_debug("RIO: %s - MC Exception handled\n", -					 __func__); -				out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), -					 0); -				regs->msr |= MSR_RI; -				regs->nip = entry->fixup; -				return 1; -			} +	const struct exception_table_entry *entry; +	unsigned long reason; + +	if (!rio_regs_win) +		return 0; + +	reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR)); +	if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) { +		/* Check if we are prepared to handle this fault */ +		entry = search_exception_tables(regs->nip); +		if (entry) { +			pr_debug("RIO: %s - MC Exception handled\n", +				 __func__); +			out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), +				 0); +			regs->msr |= MSR_RI; +			regs->nip = entry->fixup; +			return 1;  		}  	} @@ -1523,7 +1524,7 @@ int fsl_rio_setup(struct platform_device *dev)  	port->priv = priv;  	port->phys_efptr = 0x100; -	priv->regs_win = ioremap(regs.start, regs.end - regs.start + 1); +	priv->regs_win = ioremap(regs.start, resource_size(®s));  	rio_regs_win = priv->regs_win;  	/* Probe the master port phy type */  |