NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60311: eMMC not powering up (used to work)



On Fri, 5 Jun 2026, Martin Husemann via gnats wrote:

Fix suggested by mlelstv. This also affects netbsd-10 and netbsd-11.

When we see an error from the host controller, delay the soft reset by 100us.

Index: sys/dev/sdmmc/sdhc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/sdmmc/sdhc.c,v
retrieving revision 1.125
diff -u -p -r1.125 sdhc.c
--- sys/dev/sdmmc/sdhc.c	9 Jan 2026 22:54:34 -0000	1.125
+++ sys/dev/sdmmc/sdhc.c	5 Jun 2026 20:37:48 -0000
@@ -2356,8 +2356,10 @@ sdhc_wait_intr(struct sdhc_host *hp, int

 	if (nointr ||
 	    (ISSET(status, SDHC_ERROR_INTERRUPT) && error)) {
-		if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED))
+		if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) {
+			sdmmc_delay(100);
 			(void)sdhc_soft_reset(hp, SDHC_RESET_CMD|SDHC_RESET_DAT);
+		}
 		hp->intr_error_status = 0;
 		status = 0;
 	}

Without this second part I get random failures (differing between cold
boot and also changing after soft reboot). The most populare failures is
"unknown MMC version 6".

The patch looks fine, but RK356x doesn't set SDHC_FLAG_ENHANCED, so I'm struggling to see how this changes anything for you?

When SDHC_FLAG_ENHANCED is NOT set, both with and without this patch, the delay and sdhc_soft_reset lines will be executed. What am I missing?



Home | Main Index | Thread Index | Old Index