From: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
To: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org
Cc: tgih.jun@samsung.com, ulf.hansson@linaro.org, chris@printf.net,
Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>
Subject: [PATCH] mmc: Add delay between CMD6 and CMD13 for Sandisk eMMC cards
Date: Tue, 9 Sep 2014 14:26:54 +0200 [thread overview]
Message-ID: <1410265614-3275-1-git-send-email-jean-michel.hautbois@vodalys.com> (raw)
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.hautbois@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
next reply other threads:[~2014-09-09 12:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 12:26 Jean-Michel Hautbois [this message]
2014-09-11 2:38 ` [PATCH] mmc: Add delay between CMD6 and CMD13 for Sandisk eMMC cards Jaehoon Chung
2014-09-15 10:08 ` Jean-Michel Hautbois
2014-09-15 10:44 ` Jaehoon Chung
2014-09-15 10:53 ` Jean-Michel Hautbois
2014-09-15 11:29 ` Jean-Michel Hautbois
2014-09-16 0:53 ` hisanao.kinkawa
2014-09-21 17:48 ` Pavel Machek
2014-09-22 2:59 ` Jaehoon Chung
2014-09-22 7:23 ` Jean-Michel Hautbois
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410265614-3275-1-git-send-email-jean-michel.hautbois@vodalys.com \
--to=jean-michel.hautbois@vodalys.com \
--cc=chris@printf.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=tgih.jun@samsung.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).