summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSan Mehat <san@android.com>2008-12-01 08:52:34 -0800
committerNitin Garg <nitin.garg@freescale.com>2014-04-21 22:34:39 -0500
commitfe7b5dfa8e56f8223b3e691c493a32e7c1ee6721 (patch)
tree00b4ba5eaea0e7526c881180872df16203def5ac /drivers/mmc
parent11aa5423b0ea0cef47074e7cd1b314545a72b68e (diff)
mmc: sd: When resuming, try a little harder to init the card
Signed-off-by: San Mehat <san@android.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/sd.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 2cf24754112d..082f5a370bb8 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1114,12 +1114,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;