diff options
| author | San Mehat <san@android.com> | 2008-12-01 08:52:34 -0800 |
|---|---|---|
| committer | John Stultz <john.stultz@linaro.org> | 2016-02-16 13:51:03 -0800 |
| commit | f1da17ac8a32e862a25de3313b6d07c6ca14be68 (patch) | |
| tree | 802293a0a32464ca8c1b1ca39399630a345f0224 | |
| parent | 94d5306d03e52653ebc18136166ad142845f99de (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 db828959d6d1..e41400bbe42f 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1127,6 +1127,9 @@ static int mmc_sd_suspend(struct mmc_host *host) static int _mmc_sd_resume(struct mmc_host *host) { int err = 0; +#ifdef CONFIG_MMC_PARANOID_SD_INIT + int retries; +#endif BUG_ON(!host); BUG_ON(!host->card); @@ -1137,7 +1140,23 @@ static int _mmc_sd_resume(struct mmc_host *host) goto out; mmc_power_up(host, host->card->ocr); +#ifdef CONFIG_MMC_PARANOID_SD_INIT + retries = 5; + while (retries) { + err = mmc_sd_init_card(host, host->card->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->card->ocr, host->card); +#endif mmc_card_clr_suspended(host->card); out: |
