[PATCH] mmc: return immediately once the dwmci data transfer fails
linjunbao
meljbao at gmail.com
Tue May 28 08:15:30 CEST 2024
Originally, when the host is in dma mode, the return status of
dwmci_data_transfer() gets overlapped by the latter DWMCI_IDINTEN query.
When the data transfer fails and the query succeeds, the failure gets
escaped. Add quick return when data transfer fails.
Signed-off-by: linjunbao <meljbao at gmail.com>
---
drivers/mmc/dw_mmc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index e103664145..e04872c432 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -372,6 +372,10 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
if (data) {
ret = dwmci_data_transfer(host, data);
+ if (ret) {
+ debug("DWMCI data transfer fail.\n");
+ return ret;
+ }
/* only dma mode need it */
if (!host->fifo_mode) {
--
2.25.1
More information about the U-Boot
mailing list