From a2547482745e4f543f7ebafdb8c9eab1ef5c7b50 Mon Sep 17 00:00:00 2001 From: Tony Lin Date: Tue, 27 Dec 2011 13:47:09 +0800 Subject: 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(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9e78f0a5064b..7b8ad2706d22 100755 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2287,6 +2287,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); @@ -2325,7 +2327,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); @@ -2357,6 +2359,7 @@ out: (host->tuning_mode == SDHCI_TUNING_MODE_1)) host->flags |= SDHCI_NEEDS_RETUNING; + mmc_release_host(host->mmc); return ret; } -- cgit v1.2.3