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

From: Yixun Lan

Date: Wed Sep 02 2026 - 04:07:37 EST


From: Long Wan <long.wan@xxxxxxxxxxxxxxxxxx>

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.

Fixes: e9cb83c10071 ("mmc: sdhci-of-k1: add comprehensive SDR tuning support")
Signed-off-by: Long Wan <long.wan@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Yixun Lan <dlan@xxxxxxxxxx>
---
drivers/mmc/host/sdhci-of-k1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
index 257c954ce587..a07e7db0853e 100644
--- a/drivers/mmc/host/sdhci-of-k1.c
+++ b/drivers/mmc/host/sdhci-of-k1.c
@@ -314,7 +314,7 @@ static int spacemit_sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
max_pass_start = current_start;
}

- if (max_pass_len < 3) {
+ if (max_pass_len < 50) {
dev_err(mmc_dev(host->mmc), "Tuning failed: no stable window found\n");
return -EIO;
}

--
2.55.0