From: Yousong Zhou <yszhou4tech@gmail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
Shawn Lin <shawn.lin@rock-chips.com>,
linux-mmc@vger.kernel.org, Yousong Zhou <yszhou4tech@gmail.com>
Subject: [PATCH 3/3] mmc: sd: Retry switching to highspeed mode in case of error
Date: Thu, 10 Sep 2015 00:33:18 +0800 [thread overview]
Message-ID: <1441816398-4330-3-git-send-email-yszhou4tech@gmail.com> (raw)
In-Reply-To: <1441816398-4330-1-git-send-email-yszhou4tech@gmail.com>
A SD card with sunxi-mmc can fail with the following error message (RCE for
response CRC error) when trying to switch to highspeed mode. But the mode
switch can almost always succeed on the second try.
Dmesg before this commit.
[ 1.112060] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.126527] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 6, RD RCE !!
[ 1.132388] sunxi-mmc 1c0f000.mmc: data error, sending stop command
[ 1.139451] sunxi-mmc 1c0f000.mmc: send stop command failed
[ 1.145056] mmc0: error -110 whilst initialising SD card
[ 1.150424] ehci-platform 1c1c000.usb: USB 2.0 started, EHCI 1.00
[ 1.156533] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 1, RTO !!
Dmesg after this commit.
[ 1.062306] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.070635] sunxi-mmc 1c0f000.mmc: smc 0 err, cmd 6, RD RCE !!
[ 1.295939] sunxi-mmc 1c0f000.mmc: data error, sending stop command
[ 1.322635] Waiting for root device /dev/mmcblk0p2...
[ 1.322691] sunxi-mmc 1c0f000.mmc: send stop command failed
[ 1.335686] mmc0: new high speed SD card at address 0002
[ 1.341557] mmcblk0: mmc0:0002 00000 974 MiB
[ 1.347021] mmcblk0: p1 p2
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
drivers/mmc/core/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index e28ebf3..7465b16 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -364,7 +364,7 @@ int mmc_sd_switch_hs(struct mmc_card *card)
return -ENOMEM;
}
- err = mmc_sd_switch(card, 1, 0, 1, status);
+ err = __mmc_sd_switch(card, 1, 0, 1, status, MMC_CMD_RETRIES);
if (err)
goto out;
--
1.7.10.4
next prev parent reply other threads:[~2015-09-09 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 16:33 [PATCH 1/3] mmc: sd: Remove superfluous error code assignment Yousong Zhou
2015-09-09 16:33 ` [PATCH 2/3] mmc: sd: Allow calling sd mode switch with retries Yousong Zhou
2015-09-10 0:33 ` Shawn Lin
2015-09-10 3:02 ` Yousong Zhou
2015-09-16 2:36 ` Jaehoon Chung
2015-09-16 3:09 ` Yousong Zhou
2015-09-16 4:17 ` Jaehoon Chung
2015-09-17 8:29 ` Yousong Zhou
2015-09-09 16:33 ` Yousong Zhou [this message]
2015-09-09 19:29 ` [PATCH 1/3] mmc: sd: Remove superfluous error code assignment Hans de Goede
2015-09-15 11:34 ` Ulf Hansson
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=1441816398-4330-3-git-send-email-yszhou4tech@gmail.com \
--to=yszhou4tech@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.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).