From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43428 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNe1q-0006TP-44 for qemu-devel@nongnu.org; Tue, 30 Nov 2010 23:11:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNUSV-00061L-Gl for qemu-devel@nongnu.org; Tue, 30 Nov 2010 12:57:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNUSV-0005wb-9O for qemu-devel@nongnu.org; Tue, 30 Nov 2010 12:57:43 -0500 From: Kevin Wolf Date: Tue, 30 Nov 2010 18:58:20 +0100 Message-Id: <1291139900-20329-17-git-send-email-kwolf@redhat.com> In-Reply-To: <1291139900-20329-1-git-send-email-kwolf@redhat.com> References: <1291139900-20329-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 16/16] ide: Reset current_addr after stopping DMA List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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 Reviewed-by: Stefan Hajnoczi --- hw/ide/pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 404f045..ad406ee 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -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 */ @@ -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 = { -- 1.7.2.3