Always wait 'command done' interrupt status bit before proceeding next command.

Sponsored by:	DARPA, AFRL
This commit is contained in:
Ruslan Bukin 2014-10-08 08:51:05 +00:00
parent 4799d48568
commit fdbf76c383
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272736

View File

@ -348,9 +348,10 @@ dwmmc_tasklet(struct dwmmc_softc *sc)
if (cmd == NULL)
return;
if (cmd->error != MMC_ERR_NONE) {
dwmmc_next_operation(sc);
} else if (!cmd->data && sc->cmd_done) {
if (!sc->cmd_done)
return;
if (cmd->error != MMC_ERR_NONE || !cmd->data) {
dwmmc_next_operation(sc);
} else if (cmd->data && sc->dto_rcvd) {
if ((cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK ||
@ -394,11 +395,8 @@ dwmmc_intr(void *arg)
dprintf("data err 0x%08x cmd 0x%08x\n",
reg, cmd->opcode);
cmd->error = MMC_ERR_FAILED;
dma_done(sc, cmd);
dma_stop(sc);
DWMMC_UNLOCK(sc);
return;
}
if (reg & SDMMC_INTMASK_CMD_DONE) {