Skip to content

Commit

Permalink
ide: Reset current_addr after stopping DMA
Browse files Browse the repository at this point in the history
Whenever SSBM is reset in the command register all state information is lost.
Restarting DMA means that current_addr must be reset to the base address of the
PRD table. The OS is not required to change the base address register before
starting a DMA operation, it can reuse the value it wrote for an earlier
request.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
kevmw committed Nov 29, 2010
1 parent c29947b commit b76876e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/ide/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void bmdma_cmd_writeb(void *opaque, uint32_t addr, uint32_t val)
#endif
}
} else {
bm->cur_addr = bm->addr;
if (!(bm->status & BM_STATUS_DMAING)) {
bm->status |= BM_STATUS_DMAING;
/* start dma transfer if possible */
Expand Down Expand Up @@ -101,7 +102,6 @@ static void bmdma_addr_write(IORange *ioport, uint64_t addr,
#endif
bm->addr &= ~(mask << shift);
bm->addr |= ((data & mask) << shift) & ~3;
bm->cur_addr = bm->addr;
}

const IORangeOps bmdma_addr_ioport_ops = {
Expand Down

0 comments on commit b76876e

Please sign in to comment.