From: Li Fei <fei.li@intel.com>
To: cjb@laptop.org, ulf.hansson@linaro.org,
johan.rudholm@stericsson.com, subhashj@codeaurora.org,
prakity@marvell.com, rafael.j.wysocki@intel.com,
thierry.reding@avionic-design.de, sachin.kamat@linaro.org
Cc: linux-mmc@vger.kernel.org, rjw@sisk.pl,
linux-kernel@vger.kernel.org, chuansheng.liu@intel.com,
fei.li@intel.com
Subject: [PATCH 2/5] mmc: core: call pm_runtime_put_sync in pm_runtime_get_sync failed case
Date: Thu, 28 Feb 2013 15:44:15 +0800 [thread overview]
Message-ID: <1362037455.6212.8.camel@fli24-HP-Compaq-8100-Elite-CMT-PC> (raw)
In-Reply-To: <1362037031.6212.3.camel@fli24-HP-Compaq-8100-Elite-CMT-PC>
Even in failed case of pm_runtime_get_sync, the usage_count
is incremented. In order to keep the usage_count with correct
value and runtime power management to behave correctly, call
pm_runtime_put(_sync) in such case.
Signed-off-by Liu Chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Li Fei <fei.li@intel.com>
---
drivers/mmc/core/sdio.c | 3 +--
drivers/mmc/core/sdio_bus.c | 4 +++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index aa0719a..45ab6f32 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -874,6 +874,7 @@ static void mmc_sdio_detect(struct mmc_host *host)
mmc_release_host(host);
+out:
/*
* Tell PM core it's OK to power off the card now.
*
@@ -887,8 +888,6 @@ static void mmc_sdio_detect(struct mmc_host *host)
*/
if (host->caps & MMC_CAP_POWER_OFF_CARD)
pm_runtime_put_sync(&host->card->dev);
-
-out:
if (err) {
mmc_sdio_remove(host);
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 5e57048..d572b31 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -136,8 +136,10 @@ static int sdio_bus_probe(struct device *dev)
*/
if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) {
ret = pm_runtime_get_sync(dev);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_sync(dev);
goto out;
+ }
}
/* Set the default block size so the driver is sure it's something
--
1.7.4.1
next prev parent reply other threads:[~2013-02-28 7:45 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-28 7:37 [PATCH 1/5] regmap: irq: call pm_runtime_put " Li Fei
2013-02-28 7:44 ` Li Fei [this message]
2013-02-28 7:51 ` [PATCH 3/5] wl1251: call pm_runtime_put_sync " Li Fei
2013-02-28 7:57 ` [PATCH 4/5] usb: " Li Fei
2013-02-28 8:02 ` [PATCH 5/5] hwspinlock/core: call pm_runtime_put " Li Fei
2013-04-05 6:27 ` Ohad Ben-Cohen
2013-04-05 11:39 ` Rafael J. Wysocki
2013-04-05 11:42 ` Rafael J. Wysocki
2013-04-05 13:13 ` Li, Fei
2013-04-05 13:20 ` [PATCH 5/5 V2] " Li Fei
2013-04-05 14:46 ` Ohad Ben-Cohen
2013-02-28 8:37 ` [PATCH 4/5] usb: call pm_runtime_put_sync " Lan Tianyu
2013-02-28 9:00 ` Li, Fei
2013-02-28 15:14 ` Alan Stern
2013-02-28 9:06 ` [PATCH 4/5 V2] " Li Fei
2013-02-28 15:17 ` Alan Stern
2013-03-01 0:38 ` Liu, Chuansheng
2013-03-01 0:50 ` Rafael J. Wysocki
2013-03-01 0:59 ` Liu, Chuansheng
2013-03-01 2:18 ` Rafael J. Wysocki
2013-03-01 2:07 ` Liu, Chuansheng
2013-03-01 2:22 ` Rafael J. Wysocki
2013-03-01 2:23 ` Liu, Chuansheng
2013-03-01 2:57 ` [PATCH 4/5 V3] usb: call pm_runtime_put_noidle " Li Fei
2013-03-01 2:59 ` Li Fei
2013-02-28 8:18 ` [PATCH 3/5] wl1251: call pm_runtime_put_sync " Luciano Coelho
2013-03-05 8:51 ` Luciano Coelho
2013-04-07 10:39 ` [PATCH 2/5] mmc: core: " Ohad Ben-Cohen
2013-04-08 1:36 ` Li, Fei
2013-04-08 1:36 ` [PATCH 2/5 V2] mmc: core: call pm_runtime_put_noidle " Li Fei
2013-04-08 12:48 ` Ohad Ben-Cohen
2013-04-12 18:15 ` Chris Ball
2013-03-01 6:55 ` [PATCH 1/5] regmap: irq: call pm_runtime_put " Mark Brown
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=1362037455.6212.8.camel@fli24-HP-Compaq-8100-Elite-CMT-PC \
--to=fei.li@intel.com \
--cc=chuansheng.liu@intel.com \
--cc=cjb@laptop.org \
--cc=johan.rudholm@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=prakity@marvell.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@sisk.pl \
--cc=sachin.kamat@linaro.org \
--cc=subhashj@codeaurora.org \
--cc=thierry.reding@avionic-design.de \
--cc=ulf.hansson@linaro.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
all inboxes | Powered by JetHome®