Re: [PATCH 6/7] mmc: sdhci-of-k1: Improve RX tuning window

From: alan

Date: Sat Sep 19 2026 - 07:58:30 EST


On Tue, Sep 15, 2026, Iker Pedrosa wrote:
> A jump from a minimum window size of 3 to 50 delay codes is quite dramatic.
> Could you clarify how 50 was chosen? Is there a specific hardware specification,
> phy datasheet recommendation, or test dataset across multiple boards that
> justifies this exact number?

50 is not my number; Yixun would need to answer where it comes from. What
I can add is what the vendor driver does. In SpacemiT's sdhci-of-k1x.c
(bianbu linux-6.6), the defaults when DT says nothing are:

#define RX_TUNING_WINDOW_THRESHOLD 80
#define RX_TUNING_DLINE_REG 0x09

The Jupiter DT overrides both together: spacemit,rx_dline_reg = <0> and
spacemit,rx_tuning_limit = <50>. So 50 is what the vendor pairs with the
finer delay-line step, not a standalone default. That makes the 5/7 ->
6/7 dependency concrete rather than theoretical.

I also need to correct what I said earlier. The current driver already
centres on the widest passing window; the "< 3" check only decides when
to give up with -EIO. Raising it to 50 does not change which window is
selected, only whether tuning fails. The 1- and 5-code windows I reported
were never the widest in their boot (the widest was 74 or more each
time), so they do not show the old threshold picking a bad window.

On the form: spacemit,sdhci.yaml has no such property, so a DT knob
would need a binding change. A compile-time default, with DT override
if the binding maintainers accept it, still seems the lower-risk option.

Thanks,
Hung-Chun