From: "NG, TZE YEE" <tze.yee.ng@altera.com>
To: "Kathpalia, Tanmay" <tanmay.kathpalia@altera.com>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
devicetree@vger.kernel.org, Ulf Hansson <ulfh@kernel.org>
Subject: Re: [PATCH v3 1/4] mmc: sdhci-cadence: abort failed tuning command on SD6HC
Date: Mon, 16 Nov 2026 15:59:40 +0800 [thread overview]
Message-ID: <a8383dc1-1e6d-4559-a636-8e1f445bdb46@altera.com> (raw)
In-Reply-To: <74458f24-9380-4c90-8f6e-6a6f345cc676@altera.com>
On 16/11/2026 3:21 am, Kathpalia, Tanmay wrote:
>
> On 06-11-2026 11:46, tze.yee.ng@altera.com wrote:
>> From: Tze Yee Ng<tze.yee.ng@altera.com>
>>
>> SD6HC uses a software tuning loop that calls mmc_send_tuning() for every
>> tap but never aborts a command that fails. When a CMD21 fails with a
>> command error the eMMC can remain in the Data state and reject the next
>> command, so the CMD6 that mmc_select_hs400() issues right after tuning
>> times out. SD is not affected because CMD12 cannot abort CMD19.
>
> Nit: The SD state diagram (Fig 4-13) shows CMD12 leaving the data state
> after CMD19; the
> tuning section just doesn't use it. Instead we can use that SD is
> unchanged because
> mmc_send_abort_tuning() only acts on CMD21.
>
Thanks Tanmay. Good catch on Fig 4-13. You are right that CMD12 does
leave the Data state after CMD19; the real reason SD is unaffected is
that mmc_send_abort_tuning() is a no-op for CMD19 and only aborts CMD21.
Reworded the commit message accordingly.
>> Request the command error from mmc_send_tuning() and, on a command
>> error, abort the tuning command with mmc_send_abort_tuning(), which is a
>> no-op for SD. This matches the generic sdhci tuning path.
>>
>> Suggested-by: Tanmay Kathpalia<tanmay.kathpalia@altera.com>
>> Signed-off-by: Tze Yee Ng<tze.yee.ng@altera.com>
>> ---
>> Changes in v3:
>> - New patch replacing the v2 1/4 PHY settle: abort the failed tuning
>> command (mmc_send_abort_tuning(), a no-op for SD) instead of masking
>> the post-tuning command timeout with a settle delay. (Tanmay Kathpalia)
>> ---
>> drivers/mmc/host/sdhci-cadence-core.c | 11 ++++++++++-
>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-cadence-core.c b/drivers/mmc/host/sdhci-cadence-core.c
>> index 745455743b01..a94296cebf47 100644
>> --- a/drivers/mmc/host/sdhci-cadence-core.c
>> +++ b/drivers/mmc/host/sdhci-cadence-core.c
>> @@ -330,9 +330,18 @@ static int sdhci_cdns_execute_tuning(struct sdhci_host *host, u32 opcode)
>> }
>>
>> for (i = 0; i < SDHCI_CDNS_MAX_TUNING_LOOP; i++) {
>> + int cmd_error = 0;
>> +
>> if (sdhci_cdns_set_tune_val(host, i) ||
>> - mmc_send_tuning(host->mmc, opcode, NULL)) { /* bad */
>> + mmc_send_tuning(host->mmc, opcode, &cmd_error)) { /* bad */
>> cur_streak = 0;
>> + /*
>> + * Abort a failed tuning command so an eMMC does not
>> + * stay in the Data state and reject the next command;
>> + * a no-op for SD.
>> + */
>> + if (cmd_error)
>> + mmc_send_abort_tuning(host->mmc, opcode);
>
> sdhci_cdns_execute_tuning() is shared with SD4HC, so this changes those
> too, and only SD6HC was
> tested. Please limit the abort to SD6HC:
>
> if (cmd_error && host->version >= SDHCI_SPEC_420)
> mmc_send_abort_tuning(host->mmc, opcode);
>
> If SD4HC should get it too, that can be a follow-up once it has been
> tested on EyeQ or UniPhier.
>
> With the SD6HC guard and the commit message fix:
> Reviewed-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
>
Agreed. I will add the SD6HC guard so the shared
sdhci_cdns_execute_tuning() only aborts on SD6HC. SD4HC can opt in as a
follow-up once it's tested on EyeQ/UniPhier. Will carry your Reviewed-by
in v4.
Thanks for the review!
Tze Yee
next prev parent reply other threads:[~2026-11-16 7:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 6:16 [PATCH v3 0/4] mmc: sdhci-cadence: SD6HC DDR50/DDR52 read-path tuning and fixes tze.yee.ng
2026-11-06 6:16 ` [PATCH v3 1/4] mmc: sdhci-cadence: abort failed tuning command on SD6HC tze.yee.ng
2026-11-15 19:24 ` Kathpalia, Tanmay
[not found] ` <74458f24-9380-4c90-8f6e-6a6f345cc676@altera.com>
2026-11-16 7:59 ` NG, TZE YEE [this message]
2026-11-06 6:16 ` [PATCH v3 2/4] mmc: sdhci-cadence6: program PHONY_DQS_TIMING for extended-read DDR tze.yee.ng
2026-11-15 14:51 ` Kathpalia, Tanmay
2026-11-06 6:16 ` [PATCH v3 3/4] dt-bindings: mmc: cdns,sd6hc: add SD6HC DDR50 read-path tuning tze.yee.ng
2026-11-06 12:40 ` Krzysztof Kozlowski
2026-11-06 6:16 ` [PATCH v3 4/4] mmc: sdhci-cadence6: read SD6HC DDR50 tuning from device tree tze.yee.ng
2026-11-15 18:47 ` Kathpalia, Tanmay
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=a8383dc1-1e6d-4559-a636-8e1f445bdb46@altera.com \
--to=tze.yee.ng@altera.com \
--cc=adrian.hunter@intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=robh@kernel.org \
--cc=tanmay.kathpalia@altera.com \
--cc=ulfh@kernel.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
all inboxes | Powered by JetHome®