mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 1/3] mci: rockchip-dwcmshc-sdhci: poll DATA_AVAIL for tuning commands
Date: Thu, 21 May 2026 10:05:05 +0200	[thread overview]
Message-ID: <20260521-rockchip-emmc-fixes-v1-1-c91908ca1fb5@pengutronix.de> (raw)
In-Reply-To: <20260521-rockchip-emmc-fixes-v1-0-c91908ca1fb5@pengutronix.de>

Per SDHCI v3.00 the controller only generates Buffer Read Ready
(SDHCI_INT_DATA_AVAIL) during a tuning sequence; CMD_COMPLETE does
not fire. Switch the wait mask for CMD19/21 so HS200 tuning can
converge. Mirrors the arasan-sdhci driver.

This is done only to put the finger on this issue. The next commit
will replace the rockchip specific rk_sdhci_send_cmd() with the
generic sdhci_send_command() which does the same.

Assisted-by: Claude Opus 4.7
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/rockchip-dwcmshc-sdhci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mci/rockchip-dwcmshc-sdhci.c b/drivers/mci/rockchip-dwcmshc-sdhci.c
index 57d5fe1369..1fdea7c4ab 100644
--- a/drivers/mci/rockchip-dwcmshc-sdhci.c
+++ b/drivers/mci/rockchip-dwcmshc-sdhci.c
@@ -333,6 +333,10 @@ static int rk_sdhci_send_cmd(struct mci_host *mci, struct mci_cmd *cmd)
 	sdhci_write32(&host->sdhci, SDHCI_ARGUMENT, cmd->cmdarg);
 	sdhci_write16(&host->sdhci, SDHCI_COMMAND, command);
 
+	/* CMD19/21 generate _only_ Buffer Read Ready interrupt */
+	if (mmc_op_tuning(cmd->cmdidx))
+		mask = SDHCI_INT_DATA_AVAIL;
+
 	ret = sdhci_wait_for_done(&host->sdhci, mask);
 	if (ret) {
 		sdhci_teardown_data(&host->sdhci, data, dma);

-- 
2.47.3




  reply	other threads:[~2026-05-21  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  8:05 [PATCH 0/3] mci: sdhci Rockchip tuning fixes Sascha Hauer
2026-05-21  8:05 ` Sascha Hauer [this message]
2026-05-21  8:05 ` [PATCH 2/3] mci: sdhci: Fix TIMEOUT_CONTROL register value Sascha Hauer
2026-05-21  8:05 ` [PATCH 3/3] mci: sdhci: rockchip: Use generic sdhci_send_command() Sascha Hauer

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=20260521-rockchip-emmc-fixes-v1-1-c91908ca1fb5@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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