Skip to contentSkip to conversation

mmc: return immediately once the dwmci data transfer fails

PATCH New linjunbao 1 participant 1 message May 28, 2024 MMC, SD and SDIO

lore
Share & tools
lore

linjunbao

author
#0 lore raw

PATCH 1/1 mmc: return immediately once the dwmci data transfer fails

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.

---

 drivers/mmc/dw_mmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/dw_mmc.c +4 -0
index e103664145..e04872c432 100644
@@ -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) {
Signature · 1 line
2.25.1