1 From 39e3d37b1f7194277b8a3ea3536a67ec2d24491e Mon Sep 17 00:00:00 2001
2 From: San Mehat <san@android.com>
3 Date: Thu, 4 Dec 2008 11:18:00 -0800
4 Subject: [PATCH 100/134] mmc: sd: Add retries in re-detection
6 Signed-off-by: San Mehat <san@android.com>
8 drivers/mmc/core/sd.c | 46 +++++++++++++++++++++++++++++++++++++++++++---
9 1 files changed, 43 insertions(+), 3 deletions(-)
11 --- a/drivers/mmc/core/sd.c
12 +++ b/drivers/mmc/core/sd.c
13 @@ -558,18 +558,37 @@ static void mmc_sd_remove(struct mmc_hos
15 static void mmc_sd_detect(struct mmc_host *host)
19 +#ifdef CONFIG_MMC_PARANOID_SD_INIT
30 * Just check if our card has been removed.
32 +#ifdef CONFIG_MMC_PARANOID_SD_INIT
34 + err = mmc_send_status(host->card, NULL);
35 + printk("%s(%s): err = %d\n", __func__, mmc_hostname(host), err);
44 + printk(KERN_ERR "%s(%s): Unable to re-detect card (%d)\n",
45 + __func__, mmc_hostname(host), err);
48 err = mmc_send_status(host->card, NULL);
51 mmc_release_host(host);
54 @@ -664,6 +683,9 @@ static const struct mmc_bus_ops mmc_sd_o
55 int mmc_attach_sd(struct mmc_host *host, u32 ocr)
58 +#ifdef CONFIG_MMC_PARANOID_SD_INIT
63 WARN_ON(!host->claimed);
64 @@ -712,9 +734,27 @@ int mmc_attach_sd(struct mmc_host *host,
66 * Detect and init the card.
68 +#ifdef CONFIG_MMC_PARANOID_SD_INIT
71 + err = mmc_sd_init_card(host, host->ocr, NULL);
80 + printk(KERN_ERR "%s: mmc_sd_init_card() failure (err = %d)\n",
81 + mmc_hostname(host), err);
85 err = mmc_sd_init_card(host, host->ocr, NULL);
90 mmc_release_host(host);