summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/core.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-09-11 14:41:55 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2015-10-26 15:59:52 +0100
commit8d1ffc8c982e4480059ef735e8f15f631e40e80c (patch)
treeb887a15e7e0660f5ec046550bc31cc63b28e09b4 /drivers/mmc/core/core.c
parent0cd2f04453fcb7bf3f38a4a72d1619636b4afa57 (diff)
downloadlinux-8d1ffc8c982e4480059ef735e8f15f631e40e80c.tar.bz2
mmc: core: Keep host claimed while invoking mmc_power_off|up()
As mmc_claim_host() invokes pm_runtime_get_sync() for the mmc host device, it's important that the host is kept claimed for *all* accesses to it via the host_ops callbacks. In some code paths for SDIO, particularly related to the PM support, mmc_power_off|up() is invoked without keeping the host claimed. Let's fix these. Moreover, mmc_start|stop_host() also invokes mmc_power_off|up() without claiming the host, let's fix these as well. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r--drivers/mmc/core/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index a3eb20bdcd97..2092a89dcf76 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2633,10 +2633,14 @@ void mmc_start_host(struct mmc_host *host)
host->f_init = max(freqs[0], host->f_min);
host->rescan_disable = 0;
host->ios.power_mode = MMC_POWER_UNDEFINED;
+
+ mmc_claim_host(host);
if (host->caps2 & MMC_CAP2_NO_PRESCAN_POWERUP)
mmc_power_off(host);
else
mmc_power_up(host, host->ocr_avail);
+ mmc_release_host(host);
+
mmc_gpiod_request_cd_irq(host);
_mmc_detect_change(host, 0, false);
}
@@ -2674,7 +2678,9 @@ void mmc_stop_host(struct mmc_host *host)
BUG_ON(host->card);
+ mmc_claim_host(host);
mmc_power_off(host);
+ mmc_release_host(host);
}
int mmc_power_save_host(struct mmc_host *host)