From: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
To: dlan@kernel.org, adrian.hunter@intel.com, ulfh@kernel.org
Cc: long.wan@linux.spacemit.com, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
spacemit@lists.linux.dev
Subject: Re: [PATCH 6/7] mmc: sdhci-of-k1: Improve RX tuning window
Date: Mon, 7 Sep 2026 23:53:00 +0800 [thread overview]
Message-ID: <20260907155300.1411173-1-alan.tseng.cs@gmail.com> (raw)
In-Reply-To: <20260902-07-k3-sdhci-fix-v1-6-b15c5d0f64fd@kernel.org>
On Wed, Sep 02, 2026 at 08:04:27AM +0000, Yixun Lan wrote:
> Raise the minimum delay codes of RX tuning window from 3 to 50, to more
> accurately retrieve a valid configuration.
>
> A window of 3 codes wide leaves no sampling margin, which will result
> tuning tests reporting success on a configuration that drifts out of the
> window under thermal or power variation.
I agree with the motivation, and I have some data from a K1 board that
supports it. But I would like to ask about making 50 a compile-time
constant.
Caveat up front: my board runs the vendor sdhci-spacemit driver
(6.6.63, compatible "spacemit,k1-x-sdhci"), not sdhci-of-k1.c, so the
numbers below are observations from that driver rather than a test of
this series. I could not test the series itself: rootfs on this board
is on the SD card driven by this controller, and there is no eMMC, so
a tuning regression means it does not boot.
Measured RX tuning windows, Milk-V Jupiter (K1), SDR104 SD card,
across three boots (the vendor driver already logs these):
mmc0 (SD, rootfs):
boot 0: [0,55) [77,255) -> widest 178
boot -1: [0,54) [77,255) -> widest 178
boot -2: [0,50) [71,76) [79,255) -> widest 176
mmc1 (SDIO):
boot 0: [0,73) [81,106) [137,255) -> widest 118
boot -1: [0,74) [81,106) [107,108) -> widest 74
boot -2: [0,76) [82,100) -> widest 76
So a threshold of 50 is comfortable here. It also supports your
rationale directly: boot -2 produced a 5-code window and boot -1
produced a 1-code window on mmc1, so the narrow-window case this
patch guards against does occur in practice.
Relevant to the delay-line question in 5/7: this board's DT already
sets spacemit,rx_dline_reg = 0, so the windows above are already at
the finest step size, i.e. they should be comparable to post-5/7
behaviour rather than to the current mainline default of 9.
My question is about the form rather than the value. The vendor
driver takes this same limit from DT, per host:
sdh@d4280000: spacemit,rx_tuning_limit = <0x32>; /* 50 */
sdh@d4280800: spacemit,rx_tuning_limit = <0x32>; /* 50 */
So 50 matches what SpacemiT already ships -- but there it is a
per-controller DT property, and this patch turns it into a global
compile-time constant. Was that deliberate? The vendor design implies
the value is expected to need per-board adjustment, and with a Fixes:
tag this will land in stable, where a board with a narrower window
would go from "adjust the DT" to "patch and rebuild the kernel".
Two options, if you think the concern is real: keep it as a DT
property (matching the existing binding), or keep the constant as a
default that DT can override.
One more thing on 5/7 and 6/7: since patch 5 changes the delay-line
step from 9 to 0, the same physical timing window spans a different
number of delay codes with and without it. If 50 is calibrated against
the finest step, then backporting 6/7 without 5/7 could reject
configurations that currently work. Both carry Fixes: tags pointing at
e9cb83c10071, so they may well be picked up separately -- might be
worth making the dependency explicit for the stable maintainers.
Thanks,
Hung-Chun Tseng <alan.tseng.cs@gmail.com>
next prev parent reply other threads:[~2026-09-07 15:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 8:04 [PATCH 0/7] mmc: spacemit: improve clock and tuning logic Yixun Lan
2026-09-02 8:04 ` [PATCH 1/7] mmc: sdhci-of-k1: no pinctrl state switching Yixun Lan
2026-09-02 8:04 ` [PATCH 2/7] mmc: sdhci-of-k1: drop duplicated voltage settings Yixun Lan
2026-09-02 8:04 ` [PATCH 3/7] mmc: sdhci-of-k1: configure PHY mode Yixun Lan
2026-09-02 8:04 ` [PATCH 4/7] mmc: sdhci-of-k1: Improve power control Yixun Lan
2026-09-02 8:04 ` [PATCH 5/7] mmc: sdhci-of-k1: Use finest delay granularity for RX tuning Yixun Lan
2026-09-02 8:04 ` [PATCH 6/7] mmc: sdhci-of-k1: Improve RX tuning window Yixun Lan
2026-09-07 15:53 ` Hung-Chun Tseng [this message]
2026-09-15 9:48 ` Iker Pedrosa
2026-09-02 8:04 ` [PATCH 7/7] mmc: sdhci-of-k1: Implement SD clock gating for voltage switch Yixun Lan
2026-09-09 8:40 ` [PATCH 0/7] mmc: spacemit: improve clock and tuning logic Adrian Hunter
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=20260907155300.1411173-1-alan.tseng.cs@gmail.com \
--to=alan.tseng.cs@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=dlan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=long.wan@linux.spacemit.com \
--cc=spacemit@lists.linux.dev \
--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®