From: Sascha Hauer <s.hauer@pengutronix.de>
To: Chaotian Jing <chaotian.jing@mediatek.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Chris Ball <chris@printf.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
Mark Rutland <mark.rutland@arm.com>,
James Liao <jamesjj.liao@mediatek.com>,
srv_heupstream@mediatek.com, Arnd Bergmann <arnd@arndb.de>,
devicetree@vger.kernel.org,
Hongzhou Yang <hongzhou.yang@mediatek.com>,
Catalin Marinas <catalin.marinas@arm.com>,
bin.zhang@mediatek.com, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, Will Deacon <will.deacon@arm.com>,
linux-gpio@vger.kernel.org, linux-mediatek@lists.infradead.org,
Sascha Hauer <kernel@pengutronix.de>,
"Joe.C" <yingjoe.chen@mediatek.com>,
Eddie Huang <eddie.huang@mediatek.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/5] mmc: mediatek: Add PM support for MMC driver
Date: Mon, 20 Apr 2015 08:49:10 +0200 [thread overview]
Message-ID: <20150420064910.GO4946@pengutronix.de> (raw)
In-Reply-To: <1426562035-16709-4-git-send-email-chaotian.jing@mediatek.com>
On Tue, Mar 17, 2015 at 11:13:53AM +0800, Chaotian Jing wrote:
> Add PM support for Mediatek MMC driver
>
> Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
> ---
> drivers/mmc/host/mtk-sd.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 93 insertions(+), 1 deletion(-)
>
> @@ -1003,6 +1042,8 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
>
> if (!IS_ERR(mmc->supply.vqmmc)) {
>
> + pm_runtime_get_sync(host->dev);
> +
> if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
> min_uv = 3300000;
> max_uv = 3300000;
> @@ -1011,6 +1052,9 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
> max_uv = 1800000;
> } else {
> dev_err(host->dev, "Unsupported signal voltage!\n");
> +
> + pm_runtime_mark_last_busy(host->dev);
> + pm_runtime_put_autosuspend(host->dev);
> return -EINVAL;
> }
>
> @@ -1022,6 +1066,8 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
> }
> }
>
> + pm_runtime_mark_last_busy(host->dev);
> + pm_runtime_put_autosuspend(host->dev);
This is unbalanced. You do a pm_runtime_get_sync() depending on
!IS_ERR(mmc->supply.vqmmc), but you call pm_runtime_put_autosuspend()
unconditionally. Besides, I don't see that the pm_ops are necessary here
at all. This function does nothing on the controller.
Sascha
--
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 |
next prev parent reply other threads:[~2015-04-20 6:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1426562035-16709-1-git-send-email-chaotian.jing@mediatek.com>
[not found] ` <1426562035-16709-4-git-send-email-chaotian.jing@mediatek.com>
2015-03-31 14:46 ` [PATCH v2 3/5] mmc: mediatek: Add PM support for MMC driver Ulf Hansson
2015-04-03 8:27 ` 答复: " Chaotian Jing (井朝天)
2015-04-20 6:49 ` Sascha Hauer [this message]
2015-04-20 6:52 ` Sascha Hauer
[not found] ` <1426562035-16709-3-git-send-email-chaotian.jing@mediatek.com>
2015-03-31 12:23 ` [PATCH v2 2/5] mmc: mediatek: Add Mediatek " Ulf Hansson
2015-04-03 7:22 ` 答复: " Chaotian Jing (井朝天)
2015-04-08 10:38 ` Ulf Hansson
2015-04-17 9:12 ` Sascha Hauer
2015-04-17 9:37 ` Ulf Hansson
2015-04-07 14:01 ` Matthias Brugger
2015-04-17 13:45 ` Sascha Hauer
[not found] ` <1426562035-16709-2-git-send-email-chaotian.jing@mediatek.com>
2015-04-20 8:31 ` [PATCH v2 1/5] mmc: dt-bindings: add Mediatek MMC bindings Sascha Hauer
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=20150420064910.GO4946@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=arnd@arndb.de \
--cc=bin.zhang@mediatek.com \
--cc=catalin.marinas@arm.com \
--cc=chaotian.jing@mediatek.com \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=eddie.huang@mediatek.com \
--cc=hongzhou.yang@mediatek.com \
--cc=jamesjj.liao@mediatek.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=srv_heupstream@mediatek.com \
--cc=ulf.hansson@linaro.org \
--cc=will.deacon@arm.com \
--cc=yingjoe.chen@mediatek.com \
/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).