From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefanha@gmail.com, mjt@tls.msk.ru
Subject: [Qemu-devel] [PATCH 4/4] ide: Reset current_addr after stopping DMA
Date: Fri, 26 Nov 2010 17:21:32 +0100 [thread overview]
Message-ID: <1290788492-17703-5-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1290788492-17703-1-git-send-email-kwolf@redhat.com>
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 <kwolf@redhat.com>
---
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
next prev parent reply other threads:[~2010-11-26 16:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-26 16:21 [Qemu-devel] [PATCH 0/4] ide: Some DMA related fixes Kevin Wolf
2010-11-26 16:21 ` [Qemu-devel] [PATCH 1/4] ide: Factor ide_dma_set_inactive out Kevin Wolf
2010-11-26 16:38 ` [Qemu-devel] " Stefan Hajnoczi
2010-11-26 16:21 ` [Qemu-devel] [PATCH 2/4] ide: Set bus master inactive on error Kevin Wolf
2010-11-26 16:40 ` [Qemu-devel] " Stefan Hajnoczi
2010-11-26 16:21 ` [Qemu-devel] [PATCH 3/4] ide: Ignore double DMA transfer starts/stops Kevin Wolf
2010-11-26 16:43 ` [Qemu-devel] " Stefan Hajnoczi
2010-11-26 16:21 ` Kevin Wolf [this message]
2010-11-26 16:45 ` [Qemu-devel] Re: [PATCH 4/4] ide: Reset current_addr after stopping DMA Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1290788492-17703-5-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).