Index: sys/dev/sdhci/sdhci.c =================================================================== --- sys/dev/sdhci/sdhci.c +++ sys/dev/sdhci/sdhci.c @@ -2280,6 +2280,18 @@ SDHCI_LOCK(slot); /* Read slot interrupt status. */ intmask = RD4(slot, SDHCI_INT_STATUS); + + /* + * We AND it with slot->intmask here in case a platform-driven transfer + * is in progress; they may turn some bits off in slot->intmask and turn + * off interrupts for those bits, while still keeping the bits enabled + * in SDHCI_INT_ENABLE for internal handling. In such a case, we want + * to make sure they're not touched here unless we're supposed to. + * SDHCI_INT_DMA_END and SDHCI_INT_RESPONSE are explicitly always + * enabled here because interrupt aggregation code may be twiddling + * these and we don't want to lose them if they're actually set. + */ + intmask &= (slot->intmask | SDHCI_INT_DMA_END | SDHCI_INT_RESPONSE); if (intmask == 0 || intmask == 0xffffffff) { SDHCI_UNLOCK(slot); return;