From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] Revert "mmc: fsl_esdhc_imx: remove the 1ms delay before sending command"
Date: Sat, 27 Feb 2021 10:53:54 -0300 [thread overview]
Message-ID: <20210227135354.1696310-1-festevam@gmail.com> (raw)
Removing the 1ms delay before sending command causes a regression
on imx8mq-evk where the SD card cannot be accessed.
Since this 1ms delay has been present since the driver introduction
in 2008, keep it to avoid regressions.
This reverts commit 9098682200e6cca4b776638a51200dafa16f50fb.
Reported-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
drivers/mmc/fsl_esdhc_imx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index e0e132698e30..a0a5c8960563 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -463,6 +463,13 @@ static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc,
while (esdhc_read32(®s->prsstat) & PRSSTAT_DLA)
;
+ /* Wait at least 8 SD clock cycles before the next command */
+ /*
+ * Note: This is way more than 8 cycles, but 1ms seems to
+ * resolve timing issues with some cards
+ */
+ udelay(1000);
+
/* Set up for a data transfer if we have one */
if (data) {
err = esdhc_setup_data(priv, mmc, data);
--
2.25.1
next reply other threads:[~2021-02-27 13:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-27 13:53 Fabio Estevam [this message]
2021-03-03 9:08 ` [PATCH] Revert "mmc: fsl_esdhc_imx: remove the 1ms delay before sending command" Bough Chen
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=20210227135354.1696310-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=u-boot@lists.denx.de \
/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