From: "Kathpalia, Tanmay" <tanmay.kathpalia@altera.com>
To: tze.yee.ng@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
Subject: Re: [PATCH v2 1/4] mmc: sdhci-cadence: add PHY settle after tuning for SD6HC
Date: Mon, 26 Oct 2026 01:47:32 +0530 [thread overview]
Message-ID: <dab17adc-1691-463f-bb85-7d1276fbf28f@altera.com> (raw)
In-Reply-To: <073f81c6e6dcc931d6e12c358b48679b2855a72a.1791459448.git.tze.yee.ng@altera.com>
Hi Tze,
Sorry for the slow reply. I spent some time going through the tuning
path against the eMMC specification before answering.
On 09-10-2026 07:44, tze.yee.ng@altera.com wrote:
> From: Tze Yee Ng <tze.yee.ng@altera.com>
>
> On SD6HC the first command after tuning may be an R1b busy command (e.g.
> the HS200->HS CMD6 during HS400 selection) that can time out on some eMMC
> unless the PHY is given a brief settle after the final tap and DLL
> re-lock.
>
> Add a single 5 to 5.5 ms settle at the end of the SD6HC tuning path,
> after the winning tap is applied, rather than on every set_tune_val()
> call in the scan.
>
> Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>
> ---
> Changes in v2:
> - Moved the 5ms PHY settle out of the per-tap tuning loop to a single
> settle after the winning tap, on the success path only.
> (Adrian Hunter, Tanmay Kathpalia)
> - Rewrote the comment to explain this specific call site.
> (Tanmay Kathpalia)
> ---
> drivers/mmc/host/sdhci-cadence-core.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-cadence-core.c b/drivers/mmc/host/sdhci-cadence-core.c
> index 745455743b01..c25b235ee909 100644
> --- a/drivers/mmc/host/sdhci-cadence-core.c
> +++ b/drivers/mmc/host/sdhci-cadence-core.c
> @@ -7,6 +7,7 @@
>
> #include <linux/bitfield.h>
> #include <linux/bits.h>
> +#include <linux/delay.h>
> #include <linux/dma-mapping.h>
> #include <linux/iopoll.h>
> #include <linux/module.h>
> @@ -352,8 +353,11 @@ static int sdhci_cdns_execute_tuning(struct sdhci_host *host, u32 opcode)
> return ret;
>
> /* Block gap tuning is only required for SD4HC, not for SD6HC */
> - if (host->version >= SDHCI_SPEC_420)
> + if (host->version >= SDHCI_SPEC_420) {
> + /* Let the PHY settle after the final tap and DLL re-lock. */
> + usleep_range(5000, 5500);
> return 0;
> + }
>
Every scan step re-locks the DLL and immediately issues CMD21, which
carries an R1 response on the CMD line, with no delay. The eMMC
specification moves the card to the Data state for CMD21 and treats
any command issued from that state as illegal. If a tap fails with a
command error, the card can remain in the Data state, so the next
command - the CMD6 that mmc_select_hs400() sends straight after
tuning gets no response and the host reports a response timeout.
Adrian added mmc_abort_tuning() in commit e711f0309109 ("mmc: mmc:
Introduce mmc_abort_tuning()") for exactly this case: a timed-out
tuning command can leave the card still processing it, and the eMMC
specification allows CMD12 to stop CMD21.
This also fits with your report that SD SDR104 never fails: CMD12
isn't defined for CMD19, which is why mmc_send_abort_tuning() is a
no-op for it. So this theory is consistent with the SD/eMMC split
you observed.
I'll test aborting each CMD21 that fails with a command error, and
also a single abort after tuning completes, to see whether that
removes the CMD6 failure. If you can test the same, that would help.
I would prefer that fix over an unconditional sleep.
Regards,
Tanmay
next prev parent reply other threads:[~2026-10-25 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 2:14 [PATCH v2 0/4] mmc: sdhci-cadence: SD6HC DDR50/DDR52 read-path tuning and fixes tze.yee.ng
2026-10-09 2:14 ` [PATCH v2 1/4] mmc: sdhci-cadence: add PHY settle after tuning for SD6HC tze.yee.ng
2026-10-25 20:17 ` Kathpalia, Tanmay [this message]
2026-10-09 2:14 ` [PATCH v2 2/4] mmc: sdhci-cadence6: program PHONY_DQS_TIMING for extended-read DDR tze.yee.ng
2026-10-09 2:14 ` [PATCH v2 3/4] dt-bindings: mmc: cdns,sd6hc: add SD6HC DDR50 read-path tuning tze.yee.ng
2026-10-12 8:48 ` Krzysztof Kozlowski
2026-10-09 2:14 ` [PATCH v2 4/4] mmc: sdhci-cadence6: read SD6HC DDR50 tuning from device tree tze.yee.ng
2026-10-18 21:19 ` [PATCH v2 0/4] mmc: sdhci-cadence: SD6HC DDR50/DDR52 read-path tuning and fixes 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=dab17adc-1691-463f-bb85-7d1276fbf28f@altera.com \
--to=tanmay.kathpalia@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=tze.yee.ng@altera.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
all inboxes | Powered by JetHome®