[PATCH 2/2] 83xx: Don't ioremap() from the reset function.

Kumar Gala galak at kernel.crashing.org
Wed Feb 7 03:50:28 EST 2007


On Feb 5, 2007, at 2:43 PM, Scott Wood wrote:

> ioremap() is not safe to call from interrupt context, so instead  
> use the
> whole-soc mapping to access the reset registers.

Nack.

I've already got a patch that fixes this issue in my tree.

- k

>
> Signed-off-by: Scott Wood <scottwood at freescale.com>
> ---
>  arch/powerpc/platforms/83xx/misc.c |   17 +++++++++--------
>  1 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/ 
> platforms/83xx/misc.c
> index f0c6df6..a4b14c1 100644
> --- a/arch/powerpc/platforms/83xx/misc.c
> +++ b/arch/powerpc/platforms/83xx/misc.c
> @@ -23,18 +23,19 @@ void mpc83xx_restart(char *cmd)
>  #define RST_OFFSET	0x00000900
>  #define RST_PROT_REG	0x00000018
>  #define RST_CTRL_REG	0x0000001c
> -	__be32 __iomem *reg;
>
> -	/* map reset register space */
> -	reg = ioremap(get_immrbase() + 0x900, 0xff);
> +	if (mpc83xx_immr) {
> +		__be32 __iomem *reg = mpc83xx_immr + RST_OFFSET;
>
> -	local_irq_disable();
> +		local_irq_disable();
>
> -	/* enable software reset "RSTE" */
> -	out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
> +		/* enable software reset "RSTE" */
> +		out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
> +
> +		/* set software hard reset */
> +		out_be32(reg + (RST_CTRL_REG >> 2), 0x2);
> +	}
>
> -	/* set software hard reset */
> -	out_be32(reg + (RST_CTRL_REG >> 2), 0x2);
>  	for (;;) ;
>  }
>
> -- 
> 1.4.4
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev




More information about the Linuxppc-dev mailing list