Patchwork [03/10] ide: Reset BMIDEA bit when the bus master is stopped

login
register
mail settings
Submitter Kevin Wolf
Date May 8, 2013, 2:28 p.m.
Message ID <1368023344-29731-4-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/242594/
State New
Headers show

Comments

Kevin Wolf - May 8, 2013, 2:28 p.m.
The device is supposed to reset the Bus Master IDE Active bit in the
status register when 0 is written to the Start/Stop Bus Master bit in
the command register.

In the common cases this happens automatically because bdrv_drain_all()
flushes the requests, but with a large PRDT it could remain set.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide/pci.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index a310975..635a364 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -312,6 +312,7 @@  void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val)
                 bdrv_drain_all();
                 assert(bm->bus->dma->aiocb == NULL);
             }
+            bm->status &= ~BM_STATUS_DMAING;
         } else {
             bm->cur_addr = bm->addr;
             if (!(bm->status & BM_STATUS_DMAING)) {