public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* am654_sdhci: mmc fail to send stop cmd
@ 2020-07-18 14:47 Jan Kiszka
  2020-07-20  1:21 ` Peng Fan
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2020-07-18 14:47 UTC (permalink / raw)
  To: u-boot

Hi all,

on one device with one specific SD-card (possibly an aging one), I'm
seeing frequent "mmc fail to send stop cmd" messages, followed by read
errors when loading kernel and dtb. -ETIMEDOUT is returned by
mmd_send_cmd. However, I can always resolve this by simply retrying the
stop command like this:

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index f36d11ddc8..9019d9f2ed 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -406,7 +406,11 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
 #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 			pr_err("mmc fail to send stop cmd\n");
 #endif
-			return 0;
+			pr_err("retrying...\n");
+			if (mmc_send_cmd(mmc, &cmd, NULL)) {
+				pr_err("failed again\n");
+				return 0;
+			}
 		}
 	}


Hardware is our IOT2050, baseline is today's master (1c4b5038afcc) with
board-enabling and a bunch of patches from your tree [1]. However,
already 4d6da10ce611 exposes the problem.

What could cause this?

Jan

[1] https://github.com/siemens/u-boot/commits/jan/iot2050

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-08-13  9:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-18 14:47 am654_sdhci: mmc fail to send stop cmd Jan Kiszka
2020-07-20  1:21 ` Peng Fan
2020-07-20  4:39   ` Jan Kiszka
2020-07-20 23:23   ` Jaehoon Chung
2020-07-21  6:36     ` Jan Kiszka
2020-07-21 17:03       ` Faiz Abbas
2020-07-21 17:22         ` Jan Kiszka
2020-07-23  3:25           ` Faiz Abbas
2020-07-23  4:14             ` Faiz Abbas
2020-08-13  9:09               ` Jan Kiszka
2020-07-23  5:25             ` Jan Kiszka
2020-07-23  5:48               ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox