diff options
author | Tony Lin <tony.lin@freescale.com> | 2011-12-27 13:47:09 +0800 |
---|---|---|
committer | Tony Lin <tony.lin@freescale.com> | 2011-12-27 14:48:26 +0800 |
commit | 3b2e3729dc57a5ff532552cde49de7ace4c5792c (patch) | |
tree | 71e9c0730eda2bebc13d319891581a78c8f72183 | |
parent | 6c3f6f9daa4d81c92c11384963ae3efa98b7aa3d (diff) |
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 <tony.lin@freescale.com>
-rw-r--r-- | drivers/mmc/host/sdhci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index ab111843f5f1..e1e7b12f4967 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1721,6 +1721,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); @@ -1751,7 +1753,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); @@ -1778,6 +1780,7 @@ out: /* sync worker */ sdhci_disable_clk(host, 0); + mmc_release_host(host->mmc); return ret; } |