Tested on a i.MX6 board, with Sandisk SDIN5D1-2G.
Without this patch, I/O errors occur.
This eMMC seems to have a different Manufacturer ID as it reads 0x45
and not 0x2 as specified in datasheet.

Signed-off-by: Jean-Michel Hautbois <jean-michel.hautb...@vodalys.com>
---
 drivers/mmc/core/mmc_ops.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index f51b5ba..91babaa 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -458,6 +458,15 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, 
u8 value,
        if (!use_busy_signal)
                return 0;
 
+       /* WORKAROUND: for Sandisk eMMC cards, it might need certain delay
+        * before sending CMD13 after CMD6
+        * On SDIN5D1-2G MANFID is 0x45 and not 0x2 as specified in datasheet
+        */
+       if (card->cid.manfid == CID_MANFID_SANDISK ||
+               card->cid.manfid == 0x45) {
+               msleep(1);
+       }
+
        /*
         * CRC errors shall only be ignored in cases were CMD13 is used to poll
         * to detect busy completion.
-- 
2.0.4

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

Reply via email to