diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -2183,6 +2183,19 @@ int err = 0; SDHCI_LOCK(slot); + /* + * If the bus is busy, it may have stopped in the middle of a + * transaction. Try to complete that transaction before continuing. + */ + if (slot->bus_busy && dumping) { + SDHCI_UNLOCK(slot); + while (slot->req != NULL) { + sdhci_generic_intr(slot); + DELAY(10); + } + sdhci_generic_release_host(brdev, reqdev); + SDHCI_LOCK(slot); + } while (slot->bus_busy) msleep(slot, &slot->mtx, 0, "sdhciah", 0); slot->bus_busy++;