From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: mmci: Improve runtime PM support
Date: Fri, 21 Oct 2011 18:36:38 +0100 [thread overview]
Message-ID: <20111021173637.GG21648@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1319210754-22775-1-git-send-email-ulf.hansson@stericsson.com>
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.
next prev parent reply other threads:[~2011-10-21 17:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 15:25 [PATCH] mmc: mmci: Improve runtime PM support Ulf Hansson
2011-10-21 17:36 ` Russell King - ARM Linux [this message]
[not found] ` <CAKnu2MrOriMzJH9NcwUivWa0cinASa6wrRf4a69si4WUs-aTrQ@mail.gmail.com>
2011-10-23 0:31 ` Sebastian Rasmussen
2011-10-24 8:05 ` Ulf Hansson
2011-10-24 9:04 ` Russell King - ARM Linux
2011-10-24 9:36 ` Ulf Hansson
2011-10-24 9:42 ` Russell King - ARM Linux
2011-10-24 10:06 ` Ulf Hansson
2011-10-24 10:14 ` Russell King - ARM Linux
2011-10-24 11:48 ` Ulf Hansson
2011-10-24 12:18 ` Linus Walleij
2011-10-24 15:25 ` Ulf Hansson
2011-10-24 15:34 ` Ulf Hansson
2011-10-25 7:12 ` Linus Walleij
2011-10-25 7:39 ` Ulf Hansson
2011-10-24 9:11 ` Sebastian Rasmussen
2011-10-24 9:14 ` Linus Walleij
2011-10-24 9:36 ` Russell King - ARM Linux
2011-10-24 9:54 ` Linus Walleij
2011-10-24 9:56 ` Russell King - ARM Linux
2011-10-24 10:17 ` Ulf Hansson
2011-10-24 11:49 ` Linus Walleij
2011-10-25 8:05 ` Adrian Hunter
2011-10-25 8:53 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111021173637.GG21648@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).