Skip to contentSkip to conversation

mmc: fsl_esdhc_imx: fix watermark level in dma

PATCH In review Marcel Ziswiler 3 participants 6 messages Jan 31, 2022 – Feb 8, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: fsl_esdhc_imx: fix watermark level in dma

From: Marcel Ziswiler <[email protected]>

Seems that we need the waterlevel setting not only for PIO mode as without this at least the i.MX 8M Mini won't boot anymore when being written by such a U-Boot. Corruption has also been observed both on the i.MX 6 as well as i.MX 8M Mini when using ums on the eMMC. Fix this by setting the watermark level again regardless of whether in DMA or PIO mode.

Fixes 41c6a22fc296 ("mmc: fsl_esdhc_imx: simplify esdhc_setup_data()")

---

 drivers/mmc/fsl_esdhc_imx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/fsl_esdhc_imx.c +2 -3
index 9299635f50..efa5ed0af7 100644
@@ -336,9 +336,8 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
 		}
 	}
 
-	if (IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO))
-		esdhc_setup_watermark_level(priv, data);
-	else
+	esdhc_setup_watermark_level(priv, data);
+	if (!IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO))
 		esdhc_setup_dma(priv, data);
 
 	/* Calculate the timeout period for data transactions */
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi Marcel,

Quoted 10 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Seems that we need the waterlevel setting not only for PIO mode as without this at least the i.MX 8M Mini won't boot anymore when being written by such a U-Boot. Corruption has also been observed both on the i.MX 6 as well as i.MX 8M Mini when using ums on the eMMC. Fix this by setting the watermark level again regardless of whether in DMA or PIO mode.

Quoted 2 lines
Fixes 41c6a22fc296 ("mmc: fsl_esdhc_imx: simplify esdhc_setup_data()")

This is probably the failure I saw on imx7 when I tried testing 'ums'.

reviewer Tested-by
#2 lore raw
Quoted 14 lines · Fabio Estevam

Hi Marcel,

Quoted 10 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Seems that we need the waterlevel setting not only for PIO mode as without this at least the i.MX 8M Mini won't boot anymore when being written by such a U-Boot. Corruption has also been observed both on the i.MX 6 as well as i.MX 8M Mini when using ums on the eMMC. Fix this by setting the watermark level again regardless of whether in DMA or PIO mode.

Quoted 6 lines
Quoted 2 lines
Fixes 41c6a22fc296 ("mmc: fsl_esdhc_imx: simplify esdhc_setup_data()")

This is probably the failure I saw on imx7 when I tried testing 'ums'.

This indeed fixes the regression I was seeing with imx7s-warp:

reviewer
#3 lore raw

Hi Jaehoon,

Quoted 19 lines · Fabio Estevam
Quoted 17 lines · Fabio Estevam

Hi Marcel,

Quoted 12 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Seems that we need the waterlevel setting not only for PIO mode as without this at least the i.MX 8M Mini won't boot anymore when being written by such a U-Boot. Corruption has also been observed both on the i.MX 6 as well as i.MX 8M Mini when using ums on the eMMC. Fix this by setting the watermark level again regardless of whether in DMA or PIO mode.

Fixes 41c6a22fc296 ("mmc: fsl_esdhc_imx: simplify esdhc_setup_data()")
Quoted 7 lines
Quoted 3 lines

This is probably the failure I saw on imx7 when I tried testing 'ums'.

This indeed fixes the regression I was seeing with imx7s-warp:

Could you please apply this fix?

Thanks

#4 lore raw

Hi Fabio,

Quoted 24 lines · Fabio Estevam

Hi Jaehoon,

Quoted 21 lines · Fabio Estevam
Quoted 19 lines · Fabio Estevam

Hi Marcel,

Quoted 10 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Seems that we need the waterlevel setting not only for PIO mode as without this at least the i.MX 8M Mini won't boot anymore when being written by such a U-Boot. Corruption has also been observed both on the i.MX 6 as well as i.MX 8M Mini when using ums on the eMMC. Fix this by setting the watermark level again regardless of whether in DMA or PIO mode.

Quoted 2 lines
Fixes 41c6a22fc296 ("mmc: fsl_esdhc_imx: simplify esdhc_setup_data()")

This is probably the failure I saw on imx7 when I tried testing 'ums'.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

This indeed fixes the regression I was seeing with imx7s-warp:

Could you please apply this fix?

Sorry for late. I had been vacation until yesterday. I'm looking for pending patches. I will pick this soon.

Best Regards,
Jaehoon Chung

Quoted 3 lines

Thanks

#5 lore raw
In reply to Marcel Ziswiler
Quoted 11 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Seems that we need the waterlevel setting not only for PIO mode as without this at least the i.MX 8M Mini won't boot anymore when being written by such a U-Boot. Corruption has also been observed both on the i.MX 6 as well as i.MX 8M Mini when using ums on the eMMC. Fix this by setting the watermark level again regardless of whether in DMA or PIO mode.

Fixes 41c6a22fc296 ("mmc: fsl_esdhc_imx: simplify esdhc_setup_data()")

Applied on u-boot-mmc/master.

Thanks!

Best Regards,
Jaehoon Chung

Quoted 22 lines

---

 drivers/mmc/fsl_esdhc_imx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/fsl_esdhc_imx.c +2 -3
index 9299635f50..efa5ed0af7 100644
@@ -336,9 +336,8 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
 		}
 	}
 
-	if (IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO))
-		esdhc_setup_watermark_level(priv, data);
-	else
+	esdhc_setup_watermark_level(priv, data);
+	if (!IS_ENABLED(CONFIG_SYS_FSL_ESDHC_USE_PIO))
 		esdhc_setup_dma(priv, data);
 
 	/* Calculate the timeout period for data transactions */