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 0/2] mci: fix read timeouts following SD card writes
Date: Mon, 19 Oct 2026 11:52:42 +0200	[thread overview]
Message-ID: <20261019-atmel-mci-fixes-v1-0-6a636f3b28ca@pengutronix.de> (raw)

On a KSZ9477-EVB (SAMA5D3), saveenv fails on the first attempt after
the SD card has been freshly flashed, and larger raw writes to the
card fail as well:

  ERROR: atmel_mci f0000000.mmc@f0000000.of: command/data timeout
  ERROR: atmel_mci f0000000.mmc@f0000000.of: command/data timeout

The card is still programming a previous write when the next read
command arrives, and does not answer it. barebox already waits for
the card to become ready before writes, but reads can still hit it
while it is busy.

The first patch makes the atmel_mci timeout message say which command
failed and how, which is what pointed to the cause. The second patch
waits for the card to become ready after each block write.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (2):
      mci: atmel_mci: improve timeout error message
      mci: wait for card to leave programming state after block writes

 drivers/mci/atmel_mci_common.c |  4 +++-
 drivers/mci/mci-core.c         | 11 ++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
---
base-commit: 6b2dee07d7189bcec749539574ff99580880e238
change-id: 20261019-atmel-mci-fixes-994fa7c17ffe

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




             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 Sascha Hauer [this message]
2026-10-19  9:52 ` [PATCH 1/2] mci: atmel_mci: improve timeout error message Sascha Hauer
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-0-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