linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: DooHyun Hwang <dh0421.hwang@samsung.com>
To: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	ulf.hansson@linaro.org, ebiggers@google.com,
	wsa+renesas@sang-engineering.com, satyat@google.com,
	ludovic.barre@st.com, linus.walleij@linaro.org
Cc: grant.jung@samsung.com, jt77.jang@samsung.com,
	junwoo80.lee@samsung.com, jangsub.yi@samsung.com,
	sh043.lee@samsung.com, cw9316.lee@samsung.com,
	sh8267.baek@samsung.com, wkon.kim@samsung.com,
	DooHyun Hwang <dh0421.hwang@samsung.com>
Subject: [PATCH] mmc: core: add a power cycle when CMD11 fails
Date: Wed, 10 Feb 2021 13:59:36 +0900	[thread overview]
Message-ID: <20210210045936.7809-1-dh0421.hwang@samsung.com> (raw)
In-Reply-To: CGME20210210051209epcas1p3e55c0cbab7313731bc6e425da6189bb4@epcas1p3.samsung.com

A power cycle is required if CMD11 fails.
CMD11 failure should be handled as no response.

If there is a timeout error that means no response to the CMD11,
do not send the CMD11 again and the power cycle is required.
Any other errors for CMD11 are the same because CMD11 failed.

On some bad SD Card, CMD11 may fail but the card may have already
invoked the voltage switch sequence.
In this case, it is necessary to retry without voltage switching
after power cycle.

Signed-off-by: DooHyun Hwang <dh0421.hwang@samsung.com>
---
 drivers/mmc/core/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 1136b859ddd8..a6674df2a7bb 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1207,7 +1207,7 @@ int mmc_set_uhs_voltage(struct mmc_host *host, u32 ocr)
 
 	err = mmc_wait_for_cmd(host, &cmd, 0);
 	if (err)
-		return err;
+		goto power_cycle;
 
 	if (!mmc_host_is_spi(host) && (cmd.resp[0] & R1_ERROR))
 		return -EIO;
-- 
2.29.0


       reply	other threads:[~2021-02-10  5:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210210051209epcas1p3e55c0cbab7313731bc6e425da6189bb4@epcas1p3.samsung.com>
2021-02-10  4:59 ` DooHyun Hwang [this message]
2021-02-25  7:43   ` [PATCH] mmc: core: add a power cycle when CMD11 fails DooHyun Hwang
2021-03-02 10:38   ` Ulf Hansson
2021-03-03  6:30     ` DooHyun Hwang
2021-03-03 10:59       ` Ulf Hansson
2021-03-03 11:29         ` DooHyun Hwang
2021-03-03  6:39     ` DooHyun Hwang

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=20210210045936.7809-1-dh0421.hwang@samsung.com \
    --to=dh0421.hwang@samsung.com \
    --cc=cw9316.lee@samsung.com \
    --cc=ebiggers@google.com \
    --cc=grant.jung@samsung.com \
    --cc=jangsub.yi@samsung.com \
    --cc=jt77.jang@samsung.com \
    --cc=junwoo80.lee@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.barre@st.com \
    --cc=satyat@google.com \
    --cc=sh043.lee@samsung.com \
    --cc=sh8267.baek@samsung.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wkon.kim@samsung.com \
    --cc=wsa+renesas@sang-engineering.com \
    /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).