mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] mmc: atmel: Make write work on sama5d3
Date: Fri,  2 Nov 2018 10:11:56 +0100	[thread overview]
Message-ID: <20181102091156.26476-1-s.hauer@pengutronix.de> (raw)

For some reason the sama5d3 needs a delay after a
MMC_CMD_STOP_TRANSMISSION command. Without it writing fails with:

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

The reason is not yet clear, so live with this hack for now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/atmel_mci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 0d3b245ced..122d999087 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -468,6 +468,10 @@ static int atmci_request(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d
 	}
 
 	stat = atmci_poll_status(host, ATMCI_CMDRDY);
+
+	if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
+		mdelay(5);
+
 	return atmci_cmd_done(host, stat);
 }
 
-- 
2.19.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2018-11-02  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02  9:11 Sascha Hauer [this message]
2018-11-02  9:14 ` Sascha Hauer
2022-12-13 14:13   ` Ahmad Fatoum

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=20181102091156.26476-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@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