Commit 3bffb800 authored by Li Fei's avatar Li Fei Committed by Chris Ball

mmc: core: call pm_runtime_put_noidle in pm_runtime_get_sync failed case

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_noidle in such case.
Signed-off-by: default avatarLiu Chuansheng <chuansheng.liu@intel.com>
Signed-off-by: default avatarLi Fei <fei.li@intel.com>
Acked-by: default avatarOhad Ben-Cohen <ohad@wizery.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent abd4190f
...@@ -861,9 +861,11 @@ static void mmc_sdio_detect(struct mmc_host *host) ...@@ -861,9 +861,11 @@ static void mmc_sdio_detect(struct mmc_host *host)
/* Make sure card is powered before detecting it */ /* Make sure card is powered before detecting it */
if (host->caps & MMC_CAP_POWER_OFF_CARD) { if (host->caps & MMC_CAP_POWER_OFF_CARD) {
err = pm_runtime_get_sync(&host->card->dev); err = pm_runtime_get_sync(&host->card->dev);
if (err < 0) if (err < 0) {
pm_runtime_put_noidle(&host->card->dev);
goto out; goto out;
} }
}
mmc_claim_host(host); mmc_claim_host(host);
......
...@@ -138,7 +138,7 @@ static int sdio_bus_probe(struct device *dev) ...@@ -138,7 +138,7 @@ static int sdio_bus_probe(struct device *dev)
if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) { if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) {
ret = pm_runtime_get_sync(dev); ret = pm_runtime_get_sync(dev);
if (ret < 0) if (ret < 0)
goto out; goto disable_runtimepm;
} }
/* Set the default block size so the driver is sure it's something /* Set the default block size so the driver is sure it's something
...@@ -158,7 +158,6 @@ static int sdio_bus_probe(struct device *dev) ...@@ -158,7 +158,6 @@ static int sdio_bus_probe(struct device *dev)
disable_runtimepm: disable_runtimepm:
if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
pm_runtime_put_noidle(dev); pm_runtime_put_noidle(dev);
out:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment