[PATCH] mxc-nand: don't disable clock in mxcnd-suspend

Sascha Hauer s.hauer at pengutronix.de
Mon Jan 11 13:00:38 EST 2010


On Mon, Jan 11, 2010 at 05:53:16PM +0100, Uwe Kleine-König wrote:
> The clock must already be off after mtd->suspend.  Disabling it again
> results in an negative overflow of the clock usage count.  This didn't
> hurt as mxcnd_resume undid it after wake up.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> Cc: David Woodhouse <dwmw2 at infradead.org>
> Cc: Sascha Hauer <s.hauer at pengutronix.de>
> Cc: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
> Cc: Vladimir Barinov <vova.barinov at gmail.com>

Acked-by: Sascha Hauer <s.hauer at pengutronix.de>

> ---
>  drivers/mtd/nand/mxc_nand.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index 84f3635..970ce6b 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -888,8 +888,12 @@ static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
>  	DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
>  
>  	ret = mtd->suspend(mtd);
> -	/* Disable the NFC clock */
> -	clk_disable(host->clk);
> +
> +	/*
> +	 * nand_suspend locks the device for exclusive access, so
> +	 * the clock must already be off.
> +	 */
> +	BUG_ON(!ret && host->clk_act);
>  
>  	return ret;
>  }
> @@ -903,8 +907,6 @@ static int mxcnd_resume(struct platform_device *pdev)
>  
>  	DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");
>  
> -	/* Enable the NFC clock */
> -	clk_enable(host->clk);
>  	mtd->resume(mtd);
>  
>  	return ret;
> -- 
> 1.6.5.2
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the linux-mtd mailing list