]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00170944 [MX6Q MMC]suspend/resume crash
authorTony Lin <tony.lin@freescale.com>
Tue, 27 Dec 2011 05:47:09 +0000 (13:47 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:42 +0000 (08:33 +0200)
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 <tony.lin@freescale.com>
drivers/mmc/host/sdhci.c

index e350f03424c2204096e734c94d667a7f96f3e13d..b3703d3cf6373575cecea9546ffe71eeb06e9b7a 100755 (executable)
@@ -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;
 }