diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2015-11-05 16:08:08 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-12-22 11:32:02 +0100 |
commit | d234d2123fa734c8018f7d01ed5d663cf5e6f665 (patch) | |
tree | 5e9ad8d55a843964c00d5e6f672ae9b92a807980 | |
parent | 86236813ff23e0e8afc6844d307fb84df98f6723 (diff) | |
download | linux-d234d2123fa734c8018f7d01ed5d663cf5e6f665.tar.gz linux-d234d2123fa734c8018f7d01ed5d663cf5e6f665.tar.bz2 linux-d234d2123fa734c8018f7d01ed5d663cf5e6f665.zip |
mmc: core: Keep host claimed in mmc_rescan() while calling host ops
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 mmc_rescan(), the ->card_event() and the ->get_cd() callback are being
invoked without claiming the host, let's fix this.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/core/core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index c1027a432785..394963d3fb18 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2576,7 +2576,9 @@ void mmc_rescan(struct work_struct *work) host->rescan_entered = 1; if (host->trigger_card_event && host->ops->card_event) { + mmc_claim_host(host); host->ops->card_event(host); + mmc_release_host(host); host->trigger_card_event = false; } @@ -2611,15 +2613,14 @@ void mmc_rescan(struct work_struct *work) */ mmc_bus_put(host); + mmc_claim_host(host); if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd && host->ops->get_cd(host) == 0) { - mmc_claim_host(host); mmc_power_off(host); mmc_release_host(host); goto out; } - mmc_claim_host(host); for (i = 0; i < ARRAY_SIZE(freqs); i++) { if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min))) break; |