diff options
author | San Mehat <san@android.com> | 2008-12-01 08:52:34 -0800 |
---|---|---|
committer | Brian Swetland <swetland@google.com> | 2011-03-29 13:57:39 -0700 |
commit | 313807f684a2b08b03d6c38dccf5efa7797665a4 (patch) | |
tree | fdc2f65e688b1aa37ee8401daff738c8ec79f464 | |
parent | bc41844e0316c3c42527b84d188cff07b92e55f4 (diff) |
mmc: sd: When resuming, try a little harder to init the card
Signed-off-by: San Mehat <san@android.com>
-rw-r--r-- | drivers/mmc/core/sd.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 8c3bd0b76f74..71d388ec272e 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -733,12 +733,31 @@ static int mmc_sd_suspend(struct mmc_host *host) static int mmc_sd_resume(struct mmc_host *host) { int err; +#ifdef CONFIG_MMC_PARANOID_SD_INIT + int retries; +#endif BUG_ON(!host); BUG_ON(!host->card); mmc_claim_host(host); +#ifdef CONFIG_MMC_PARANOID_SD_INIT + retries = 5; + while (retries) { + err = mmc_sd_init_card(host, host->ocr, host->card); + + if (err) { + printk(KERN_ERR "%s: Re-init card rc = %d (retries = %d)\n", + mmc_hostname(host), err, retries); + mdelay(5); + retries--; + continue; + } + break; + } +#else err = mmc_sd_init_card(host, host->ocr, host->card); +#endif mmc_release_host(host); return err; |