Skip to contentSkip to conversation

mmc: core: Add claiming a host during mmc_cache_ctrl

PATCH RESEND In review Seungwon Jeon 1 participant 1 message Dec 26, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v2 2/2 mmc: core: Add claiming a host during mmc_cache_ctrl

While calling mmc_cache_ctrl() a host is not claimed. This patch adds the mmc_try_claim_host() for quick response in suspend.

---
 drivers/mmc/core/core.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/mmc/core/core.c +7 -1
index 83ac6e6..efdbf9d 100644
@@ -2359,7 +2359,13 @@ int mmc_suspend_host(struct mmc_host *host)
 		cancel_delayed_work(&host->disable);
 	cancel_delayed_work(&host->detect);
 	mmc_flush_scheduled_work();
-	err = mmc_cache_ctrl(host, 0);
+	if (mmc_try_claim_host(host)) {
+		err = mmc_cache_ctrl(host, 0);
+		mmc_do_release_host(host);
+	} else {
+		err = -EBUSY;
+	}
+
 	if (err)
 		goto out;
 
Signature · 1 line
1.7.0.4