From: Tony Lin Date: Tue, 27 Dec 2011 05:47:09 +0000 (+0800) Subject: ENGR00170944 [MX6Q MMC]suspend/resume crash X-Git-Tag: v3.0.35-fsl~1708 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0800a4d944befa8b82b04eae2446c3a91bba7393;p=karo-tx-linux.git 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 --- 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; }