@@ -2182,8 +2182,19 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
}
if (pending & SDMMC_INT_CMD_DONE) {
+ u32 err = (pending | host->cmd_status) &
+ SDMMC_INT_RESP_ERR;
+ struct dw_mci_slot *slot = host->cur_slot;
+
mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE);
- dw_mci_cmd_interrupt(host, pending);
+ if (err && dw_mci_card_busy(slot->mmc)) {
+ u32 ctrl = mci_readl(host, CTRL);
+
+ ctrl |= SDMMC_CTRL_ALL_RESET_FLAGS;
+ mci_writel(host, CTRL, ctrl);
+ clear_bit(DW_MMC_CARD_PRESENT, &slot->flags);
+ } else
+ dw_mci_cmd_interrupt(host, pending);
}
if (pending & SDMMC_INT_CD) {