[PATCH 0/2] mci: fix read timeouts following SD card writes
Sascha Hauer
s.hauer at pengutronix.de
Mon Oct 19 02:52:42 PDT 2026
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 at f0000000.of: command/data timeout
ERROR: atmel_mci f0000000.mmc at 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 at 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 at pengutronix.de>
More information about the barebox
mailing list