From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 1/2] mci: atmel_mci: improve timeout error message
Date: Mon, 19 Oct 2026 11:52:43 +0200 [thread overview]
Message-ID: <20261019-atmel-mci-fixes-v1-1-6a636f3b28ca@pengutronix.de> (raw)
In-Reply-To: <20261019-atmel-mci-fixes-v1-0-6a636f3b28ca@pengutronix.de>
On a command timeout, the driver only prints "command/data timeout",
which says neither which command failed nor whether the card did not
respond at all (RTOE) or the data phase timed out (DTOE).
Print the command index, the kind of timeout and the raw status
register instead, e.g.:
ERROR: atmel_mci f0000000.mmc@f0000000.of: CMD18: response timeout (SR=0x04100005)
This made it possible to see that it was a read command that the card
did not answer while it was still programming a previous write.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/mci/atmel_mci_common.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mci/atmel_mci_common.c b/drivers/mci/atmel_mci_common.c
index 170c021eba..3a081b8b63 100644
--- a/drivers/mci/atmel_mci_common.c
+++ b/drivers/mci/atmel_mci_common.c
@@ -243,7 +243,9 @@ static int atmci_read_response(struct atmel_mci *host, unsigned int stat)
resp = (u32 *)cmd->response;
if (stat & (ATMCI_RTOE | ATMCI_DTOE)) {
- dev_err(host->hw_dev, "command/data timeout\n");
+ dev_err(host->hw_dev, "CMD%u: %s timeout (SR=0x%08x)\n",
+ cmd->cmdidx, stat & ATMCI_RTOE ? "response" : "data",
+ stat);
return -ETIMEDOUT;
} else if ((stat & ATMCI_RCRCE) && (cmd->resp_type & MMC_RSP_CRC)) {
dev_err(host->hw_dev, "cmd crc error\n");
--
2.47.3
next prev parent reply other threads:[~2026-10-19 9:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 9:52 [PATCH 0/2] mci: fix read timeouts following SD card writes Sascha Hauer
2026-10-19 9:52 ` Sascha Hauer [this message]
2026-10-19 9:52 ` [PATCH 2/2] mci: wait for card to leave programming state after block writes Sascha Hauer
2026-10-19 11:44 ` [PATCH 0/2] mci: fix read timeouts following SD card writes 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=20261019-atmel-mci-fixes-v1-1-6a636f3b28ca@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