mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] mci: sdhci: suppress register dump on expected time out
@ 2026-05-27  8:49 Ahmad Fatoum
  2026-05-28 10:55 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-05-27  8:49 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

A time out is the usual way a non-existent SD-Card is detected if there
is no card detect.

Emitting a whole register dump in that case is just confusing, so
suppress register dumps on timeout during card probe.

Fixes: 19ce0bdebf48 ("mci: sdhci: rockchip: Use generic sdhci_send_command()")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/sdhci.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index 0d20f3b63e02..3474ef129bd5 100644
--- a/drivers/mci/sdhci.c
+++ b/drivers/mci/sdhci.c
@@ -116,6 +116,13 @@ static void sdhci_reset_for_reason(struct sdhci *host, enum sdhci_reset_reason r
 
 #define sdhci_reset_for(h, r) sdhci_reset_for_reason((h), SDHCI_RESET_FOR_##r)
 
+static inline bool sdhci_card_ready(struct sdhci *sdhci)
+{
+	struct mci_host *host = sdhci->mci;
+
+	return host && host->mci->ready_for_use;
+}
+
 int sdhci_send_command(struct sdhci *host, struct mci_cmd *cmd)
 {
 	u32 mask, command, xfer;
@@ -157,7 +164,12 @@ int sdhci_send_command(struct sdhci *host, struct mci_cmd *cmd)
 	ret = sdhci_wait_for_done(host, mask);
 	if (ret) {
 		sdhci_teardown_data(host, cmd->data, dma);
-		sdhci_dumpregs(host);
+#ifndef DEBUG
+		if (sdhci_card_ready(host) || ret != -ETIMEDOUT)
+#endif
+		{
+			sdhci_dumpregs(host);
+		}
 		goto error;
 	}
 
-- 
2.47.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-28 10:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-27  8:49 [PATCH master] mci: sdhci: suppress register dump on expected time out Ahmad Fatoum
2026-05-28 10:55 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox