Re: [PATCH 6/7] mmc: sdhci-of-k1: Improve RX tuning window
From: Yixun Lan
Date: Tue Dec 01 2026 - 01:30:10 EST
Hi
On 19:58 Sat 19 Sep , alan wrote:
> 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:
>
The 50 number is a configuration suggested from vendor, which should work
for all boards, it's still an value derived from statistics, not caclulated
precisely..
> #define RX_TUNING_WINDOW_THRESHOLD 80
Choose 50 here to be less aggresive, which should satisfy the tuning case
> #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.
>
Right, it actually check the final widest tunning window, and abort if
smaller than it, for the worst case!
> 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.
>
It's just not neccessary, introducing a DT property is overkill, it's probably
only useful for debugging purpose, while we stride hard to not introduce
DT property which isn't necessary. For compile-time default, are you suggesting
a CONFIG option or just a C-Code maro? I would go for latter
To be clear, I object to introduce a DT property for the window limit.
--
Yixun Lan (dlan)