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".