From: Magnus Damm <magnus.damm@gmail.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org,
Magnus Damm <damm@opensource.se>
Subject: Re: [PATCH/RFC] mmc: sh_mmcif: maximize power saving
Date: Fri, 27 May 2011 18:51:01 +0900 [thread overview]
Message-ID: <BANLkTinaDmLCvPB4_2konsomPYJhNFXzhg@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1105261524120.9307@axis700.grange>
Hi Guennadi,
On Thu, May 26, 2011 at 10:33 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> This patch uses runtime PM to allow the system to power down the MMC
> controller, when the MMC closk is switched off.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>
> Patches have been submitted earlier for SDHCI to accomplish something
> similar, but they have complicated dependencies upon other different
> subsystems, especially on PCI. MMCIF is easier - it only exists in
> different SoCs, so, this change should also be easier to review, verify
> and test.
Nice to see improved Power Management for the MMCIF driver!
> @@ -901,8 +902,16 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> return;
> }
>
> - if (ios->clock)
> + if (ios->clock) {
> + if (!host->power) {
> + if (p->set_pwr)
> + p->set_pwr(host->pd, ios->power_mode);
> + pm_runtime_get_sync(&host->pd->dev);
> + host->power = true;
> + sh_mmcif_sync_reset(host);
> + }
> sh_mmcif_clock_control(host, ios->clock);
You seem to be resetting the MMCIF block regardless if the power has
been cut or not. This may work well, but perhaps your code can be
improved to not reset when only clocks have been stopped? Resetting
when not needed will only result in unnecessary overhead. I believe
the Runtime PM suspend/resume callbacks can be used for determining if
the power has been cut or not.
Please make a V2 on top of Rafael's power domain control code later
when 2.6.40-rc has been released.
Thanks!
/ magnus
next prev parent reply other threads:[~2011-05-27 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-26 13:33 [PATCH/RFC] mmc: sh_mmcif: maximize power saving Guennadi Liakhovetski
2011-05-27 9:51 ` Magnus Damm [this message]
2011-07-13 23:23 ` Guennadi Liakhovetski
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=BANLkTinaDmLCvPB4_2konsomPYJhNFXzhg@mail.gmail.com \
--to=magnus.damm@gmail.com \
--cc=damm@opensource.se \
--cc=g.liakhovetski@gmx.de \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.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).