* [PATCH] Revert "mmc: fsl_esdhc_imx: remove the 1ms delay before sending command"
@ 2021-02-27 13:53 Fabio Estevam
2021-03-03 9:08 ` Bough Chen
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2021-02-27 13:53 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] Revert "mmc: fsl_esdhc_imx: remove the 1ms delay before sending command"
2021-02-27 13:53 [PATCH] Revert "mmc: fsl_esdhc_imx: remove the 1ms delay before sending command" Fabio Estevam
@ 2021-03-03 9:08 ` Bough Chen
0 siblings, 0 replies; 2+ messages in thread
From: Bough Chen @ 2021-03-03 9:08 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Fabio Estevam [mailto:festevam at gmail.com]
> Sent: 2021?2?27? 21:54
> To: Peng Fan <peng.fan@nxp.com>
> Cc: u-boot at lists.denx.de; lorusak at gmail.com;
> andrey.zhizhikin at leica-geosystems.com; Ye Li <ye.li@nxp.com>; Bough Chen
> <haibo.chen@nxp.com>; sbabic at denx.de; trini at konsulko.com; Fabio Estevam
> <festevam@gmail.com>
> Subject: [PATCH] Revert "mmc: fsl_esdhc_imx: remove the 1ms delay before
> sending command"
>
> 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.
>
Hi Fabio,
This 1ms delay exist in esdhc_send_cmd_common, which means every time we
send a command, will delay 1ms, which will involve a huge delay overall for
the whole u-boot cycle.
For the issue you meet, I already find the root cause, and already reply in
the mail loop: [EXT] Re: [PATCH 4/4] imx8mq_evk: Enable the USB3.0 host port
So I think no need to involve this 1ms back again.
Best regards
Haibo Chen
> 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 part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 9571 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210303/88e49e01/attachment.bin>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-03 9:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-27 13:53 [PATCH] Revert "mmc: fsl_esdhc_imx: remove the 1ms delay before sending command" Fabio Estevam
2021-03-03 9:08 ` Bough Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox