The current implementation only resumes DMA transfers when incoming data is
received from the target device, but this is also required for non-DMA transfers
with the next set of non-DMA changes.
Rather than duplicate the DMA/non-DMA dispatch logic in the initial transfer
section, update the code so that the initial transfer section can just
fallthrough to the main DMA/non-DMA dispatch logic.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <
20210519100803.10293-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
s->rregs[ESP_RSTAT] |= STAT_TC;
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
-
- /*
- * If data is ready to transfer and the TI command has already
- * been executed, start DMA immediately. Otherwise DMA will start
- * when host sends the TI command
- */
- if (s->ti_size && (s->rregs[ESP_CMD] == (CMD_TI | CMD_DMA))) {
- esp_do_dma(s);
- }
- return;
}
if (s->ti_cmd == 0) {
return;
}
- if (s->ti_cmd & CMD_DMA) {
+ if (s->ti_cmd == (CMD_TI | CMD_DMA)) {
if (dmalen) {
esp_do_dma(s);
} else if (s->ti_size <= 0) {
esp_dma_done(s);
esp_lower_drq(s);
}
- } else {
+ } else if (s->ti_cmd == CMD_TI) {
esp_do_nodma(s);
}
}