提交 d234d212 编写于 作者: U Ulf Hansson

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: NUlf Hansson <ulf.hansson@linaro.org>
上级 86236813
...@@ -2576,7 +2576,9 @@ void mmc_rescan(struct work_struct *work) ...@@ -2576,7 +2576,9 @@ void mmc_rescan(struct work_struct *work)
host->rescan_entered = 1; host->rescan_entered = 1;
if (host->trigger_card_event && host->ops->card_event) { if (host->trigger_card_event && host->ops->card_event) {
mmc_claim_host(host);
host->ops->card_event(host); host->ops->card_event(host);
mmc_release_host(host);
host->trigger_card_event = false; host->trigger_card_event = false;
} }
...@@ -2611,15 +2613,14 @@ void mmc_rescan(struct work_struct *work) ...@@ -2611,15 +2613,14 @@ void mmc_rescan(struct work_struct *work)
*/ */
mmc_bus_put(host); mmc_bus_put(host);
mmc_claim_host(host);
if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd && if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd &&
host->ops->get_cd(host) == 0) { host->ops->get_cd(host) == 0) {
mmc_claim_host(host);
mmc_power_off(host); mmc_power_off(host);
mmc_release_host(host); mmc_release_host(host);
goto out; goto out;
} }
mmc_claim_host(host);
for (i = 0; i < ARRAY_SIZE(freqs); i++) { for (i = 0; i < ARRAY_SIZE(freqs); i++) {
if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min))) if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min)))
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册