From 827757cfedf68124f1868bbff9c26d35c9f14b7e Mon Sep 17 00:00:00 2001 From: Tony Lin Date: Tue, 27 Dec 2011 13:47:09 +0800 Subject: [PATCH] ENGR00170944 [MX6Q MMC]suspend/resume crash if the system suspend in the process of data transfer, current request is broken by the suspend request, thus there're sd/mmc requests error logs. to prevent this error, add a claim host in suspend function and release it in resume function to make sure the request is finished before entering suspend and next request could be started after resuming. Signed-off-by: Tony Lin --- drivers/mmc/host/sdhci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index e350f03424c2..b3703d3cf637 100755 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2286,6 +2286,8 @@ int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state) { int ret; + mmc_claim_host(host->mmc); + sdhci_enable_clk(host); sdhci_disable_card_detection(host); @@ -2323,7 +2325,7 @@ int sdhci_resume_host(struct sdhci_host *host) if (host->vmmc) { int ret = regulator_enable(host->vmmc); if (ret) - return ret; + goto out; } sdhci_enable_clk(host); @@ -2355,6 +2357,7 @@ out: (host->tuning_mode == SDHCI_TUNING_MODE_1)) host->flags |= SDHCI_NEEDS_RETUNING; + mmc_release_host(host->mmc); return ret; } -- 2.39.5