Almost all the places, before calling hw_reset ops, the card type is checked
to make sure it is eMMC but missed during mmc_rescan_try_freq.
The below patch adds the check for card type before calling hardware reset
for init as double safety measure.

>From e7941c5b3b4999318feb59fa83b78c15c13493b3 Mon Sep 17 00:00:00 2001
From: Prasanna NAVARATNA <prasanna.navara...@broadcom.com>
Date: Mon, 12 Aug 2013 12:26:57 +0530
Subject: [PATCH] mmc: core: add check for card type before
 mmc_hw_reset_for_init

During mmc_hw_reset_for_init, the card type is not checked before
calling hw_reset ops.
Add check for the card type as emmc before issuing hw_reset during init.

Signed-off-by: Prasanna NAVARATNA <prasanna.navara...@broadcom.com>
---
 drivers/mmc/core/core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 49a5bca..2dad69a 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2196,7 +2196,8 @@ EXPORT_SYMBOL(mmc_set_blockcount);
 
 static void mmc_hw_reset_for_init(struct mmc_host *host)
 {
-       if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
+       if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset ||
+                       !mmc_card_mmc(host->card))
                return;
        mmc_host_clk_hold(host);
        host->ops->hw_reset(host);
-- 
1.7.6




--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to