U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: linjunbao <meljbao@gmail.com>
To: u-boot@lists.denx.de
Cc: linjunbao <meljbao@gmail.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Jonas Karlman <jonas@kwiboo.se>, Peng Fan <peng.fan@nxp.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	Tom Rini <trini@konsulko.com>,
	Yang Xiwen <forbidden405@outlook.com>
Subject: [PATCH] mmc: return immediately once the dwmci data transfer fails
Date: Tue, 28 May 2024 14:15:30 +0800	[thread overview]
Message-ID: <20240528061530.675258-1-meljbao@gmail.com> (raw)

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@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


             reply	other threads:[~2024-05-28 16:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28  6:15 linjunbao [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-28  6:01 [PATCH] mmc: return immediately once the dwmci data transfer fails linjunbao

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=20240528061530.675258-1-meljbao@gmail.com \
    --to=meljbao@gmail.com \
    --cc=forbidden405@outlook.com \
    --cc=jh80.chung@samsung.com \
    --cc=jonas@kwiboo.se \
    --cc=pbrobinson@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=trini@konsulko.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