All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Avri Altman <Avri.Altman@wdc.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [PATCH 0/3] mmc: also abort tuning with CMD12 for SD
Date: Thu, 23 Sep 2021 10:13:52 +0200	[thread overview]
Message-ID: <YUw3QMa07jOTB4wO@ninjato> (raw)
In-Reply-To: <DM6PR04MB65756FA165B1263AFCE45B2AFCDD9@DM6PR04MB6575.namprd04.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2438 bytes --]

Hi Avri,

first of all, thank you very much for asking your SD experts and
providing this valuable information! This is much appreciated. Sadly, I
have only indirect access to the SD specs and more advanced measurement
techniques.

> "We are ok with host sending CMD12 to abort data transfer when they
> discover failure with response / incoming data. In both SD/eMMC spec,
> stop transmission command is allowed during data transfer phase
> ('data' state).

Yes. The spec is clear about the data state.

> Sometimes, the CMD12 would have been received by card while in 'tran'
> state. As long host is able to handle the 'illegal command' error
> indication for this situation, we don't see any other problem. 

Confirmed. The call to mmc_send_abort_tuning() returns -EILSEQ. But it
still makes the card work. Leaving out the call to
mmc_send_abort_tuning() gives:

	mmc1: error -5 whilst initialising SD card

> Per SD Spec, CMD12 is allowed in 'tran' state only for SDUC card. In
> non SDUC cards, CMD12 received while in 'tran' state will be treated
> as illegal command.

I didn't know about SDUC. The advantage of the approach Ulf suggested is
that we can distinguish the type of cards in the SD callback if needed.

> However we could not understand how aborting the data transfer is
> helping host to complete the tuning scheme and have successful read /
> write operations."

I also didn't know why. But read on, there is a pointer now.

> They also think that :
> " we believe this hack was added to avoid the data transfer after response crc error...
> Receiving CRC error with the tuning pattern would be normal as long as the tuning was not complete."

Yes, I get CRC and CMD_IDX errors for CMD19.

> My 5 cents are, maybe you should try retries > 0 in sd_send_abort_tuning,
> If indeed it's a crc while tuning is not complete.

Interesting. If I do this, I get a timeout error from
mmc_send_abort_tuning(). And bingo! If I replace mmc_send_abort_tuning()
with mdelay(100) the card also probes fine. Also, if I skip this patch
series (so abort_tuning is only for MMC) and add the delay in my host
driver, then the card also comes up. I don't think, though, I should fix
it in the host driver.

Is there a delay defined somewhere which ones need to wait after a CRC
error in tuning? I couldn't find it in the simplified spec.

Thanks for the help again,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2021-09-23  8:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 18:20 [PATCH 0/3] mmc: also abort tuning with CMD12 for SD Wolfram Sang
2021-09-14 18:20 ` [PATCH 1/3] mmc: core: add helper to send STOP Wolfram Sang
2021-09-23 11:49   ` Ulf Hansson
2021-09-14 18:20 ` [PATCH 2/3] mmc: core: also abort tuning with CMD12 for SD Wolfram Sang
2021-09-23 11:51   ` Ulf Hansson
2021-09-28 15:13     ` Wolfram Sang
2021-09-14 18:20 ` [PATCH 3/3] mmc: core: remove obsolete parameter from mmc_send_abort_tuning Wolfram Sang
2021-09-15  8:27 ` [PATCH 0/3] mmc: also abort tuning with CMD12 for SD Geert Uytterhoeven
2021-09-15  8:32   ` Wolfram Sang
2021-09-15  8:50 ` Christian Löhle
2021-09-15 11:17   ` Wolfram Sang
2021-09-17  6:11 ` Avri Altman
2021-09-23  8:13   ` Wolfram Sang [this message]

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=YUw3QMa07jOTB4wO@ninjato \
    --to=wsa+renesas@sang-engineering.com \
    --cc=Avri.Altman@wdc.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.