Re: [PATCH] mmc: mmci: Improve runtime PM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 21, 2011 at 05:25:54PM +0200, Ulf Hansson wrote:
> +#ifdef CONFIG_PM_RUNTIME
> +static int mmci_runtime_suspend(struct device *dev)
> +{
> +	struct amba_device *adev = to_amba_device(dev);
> +	struct mmc_host *mmc = amba_get_drvdata(adev);
> +	unsigned long flags;
> +
> +	if (mmc) {
> +		struct mmci_host *host = mmc_priv(mmc);
> +
> +		spin_lock_irqsave(&host->lock, flags);
> +
> +		/* Save registers for POWER, CLOCK and IRQMASK0 */
> +		host->irqmask0_reg = readl(host->base + MMCIMASK0);
> +		host->pwr_reg = readl(host->base + MMCIPOWER);
> +		host->clk_reg = readl(host->base + MMCICLOCK);
> +
> +		/*
> +		 * Make sure we do not get any interrupts when we disabled the
> +		 * clock and the regulator and as well make sure to clear the
> +		 * registers for clock and power.
> +		 */
> +		writel(0, host->base + MMCIMASK0);
> +		writel(0, host->base + MMCIPOWER);
> +		writel(0, host->base + MMCICLOCK);

Err, no.  You're not allowed to power down the card between commands
unless the card has been removed or been has finished with.

If you power down the card (which you _are_ doing by writing zero to
the MMCIPOWER register), then you have to do a full setup of the card
when you resume.

This is completely unsuitable for runtime-PM usage.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux