From: Yixun Lan <dlan@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>, Ulf Hansson <ulfh@kernel.org>
Cc: Long Wan <long.wan@linux.spacemit.com>,
Troy Mitchell <troy.mitchell@linux.spacemit.com>,
Hung-Chun Tseng <alan.tseng.cs@gmail.com>,
Iker Pedrosa <ikerpedrosam@gmail.com>,
Anand Moon <linux.amoon@gmail.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Trevor Gamblin <tgamblin@baylibre.com>,
Vincent Legoll <legoll@online.fr>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
Yixun Lan <dlan@kernel.org>
Subject: [PATCH RESEND v2 7/8] mmc: sdhci-of-k1: Improve RX tuning window
Date: Tue, 01 Dec 2026 10:54:46 +0000 [thread overview]
Message-ID: <20261201-07-k3-sdhci-fix-v2-7-6645f4fe6eb1@kernel.org> (raw)
In-Reply-To: <20261201-07-k3-sdhci-fix-v2-0-6645f4fe6eb1@kernel.org>
From: Long Wan <long.wan@linux.spacemit.com>
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@linux.spacemit.com>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
drivers/mmc/host/sdhci-of-k1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
index ba01434284eb..9f15cc6a4a8c 100644
--- a/drivers/mmc/host/sdhci-of-k1.c
+++ b/drivers/mmc/host/sdhci-of-k1.c
@@ -87,6 +87,7 @@
#define SPACEMIT_RX_DLINE_REG 0
#define SPACEMIT_RX_TUNE_DELAY_MIN 0x0
#define SPACEMIT_RX_TUNE_DELAY_MAX 0xFF
+#define SPACEMIT_RX_TUNE_WINDOW_LIMIT 50
#define SPACEMIT_TX_TUNING_DLINE_REG 0x00
#define SPACEMIT_TX_TUNING_DELAYCODE 127
@@ -316,7 +317,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 < SPACEMIT_RX_TUNE_WINDOW_LIMIT) {
dev_err(mmc_dev(host->mmc), "Tuning failed: no stable window found\n");
return -EIO;
}
--
2.56.0
next prev parent reply other threads:[~2026-12-01 10:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 10:54 [PATCH RESEND v2 0/8] mmc: spacemit: Improve clock and tuning logic Yixun Lan
2026-12-01 10:54 ` [PATCH RESEND v2 1/8] mmc: sdhci-of-k1: No pinctrl state switching Yixun Lan
2026-12-01 10:54 ` [PATCH RESEND v2 2/8] mmc: sdhci-of-k1: Handle clock probe deferral Yixun Lan
2026-12-01 10:54 ` [PATCH RESEND v2 3/8] mmc: sdhci-of-k1: Drop duplicated voltage settings Yixun Lan
2026-12-01 10:54 ` [PATCH RESEND v2 4/8] mmc: sdhci-of-k1: Improve power control Yixun Lan
2026-12-01 10:54 ` [PATCH RESEND v2 5/8] mmc: sdhci-of-k1: Configure PHY mode Yixun Lan
2026-12-01 10:54 ` [PATCH RESEND v2 6/8] mmc: sdhci-of-k1: Use finest delay granularity for RX tuning Yixun Lan
2026-12-01 10:54 ` Yixun Lan [this message]
2026-12-01 10:54 ` [PATCH RESEND v2 8/8] mmc: sdhci-of-k1: Implement SD clock gating for voltage switch Yixun Lan
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=20261201-07-k3-sdhci-fix-v2-7-6645f4fe6eb1@kernel.org \
--to=dlan@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alan.tseng.cs@gmail.com \
--cc=ikerpedrosam@gmail.com \
--cc=legoll@online.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux.amoon@gmail.com \
--cc=long.wan@linux.spacemit.com \
--cc=spacemit@lists.linux.dev \
--cc=tgamblin@baylibre.com \
--cc=troy.mitchell@linux.spacemit.com \
--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®