qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/4] ehci: fix td writeback
Date: Wed, 20 Jun 2012 14:41:45 +0200	[thread overview]
Message-ID: <1340196107-6309-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1340196107-6309-1-git-send-email-kraxel@redhat.com>

Only write back the dwords the hc is supposed to update.  Should not
make a difference in theory as the guest must not touch the td while
it is active to avoid races.  But it is still more correct.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-ehci.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index f5fc008..9fb6423 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2070,6 +2070,7 @@ out:
 static int ehci_state_writeback(EHCIQueue *q)
 {
     EHCIPacket *p = QTAILQ_FIRST(&q->packets);
+    uint32_t *qtd, addr;
     int again = 0;
 
     /*  Write back the QTD from the QH area */
@@ -2077,8 +2078,9 @@ static int ehci_state_writeback(EHCIQueue *q)
     assert(p->qtdaddr == q->qtdaddr);
 
     ehci_trace_qtd(q, NLPTR_GET(p->qtdaddr), (EHCIqtd *) &q->qh.next_qtd);
-    put_dwords(q->ehci, NLPTR_GET(p->qtdaddr), (uint32_t *) &q->qh.next_qtd,
-               sizeof(EHCIqtd) >> 2);
+    qtd = (uint32_t *) &q->qh.next_qtd;
+    addr = NLPTR_GET(p->qtdaddr);
+    put_dwords(q->ehci, addr + 2 * sizeof(uint32_t), qtd + 2, 2);
     ehci_free_packet(p);
 
     /*
-- 
1.7.1

  parent reply	other threads:[~2012-06-20 12:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 12:41 [Qemu-devel] [PATCH 0/4] usb attached scsi Gerd Hoffmann
2012-06-20 12:41 ` [Qemu-devel] [PATCH 1/4] ehci: fix ehci_qh_do_overlay Gerd Hoffmann
2012-06-20 12:41 ` Gerd Hoffmann [this message]
2012-06-20 12:41 ` [Qemu-devel] [PATCH 3/4] usb: add usb attached scsi emulation Gerd Hoffmann
2012-07-01 13:36   ` Paolo Bonzini
2012-07-02 11:20     ` Gerd Hoffmann
2012-06-20 12:41 ` [Qemu-devel] [PATCH 4/4] [wip] ehci: don't flush cache on dorbell rings Gerd Hoffmann
2012-06-21  9:28   ` Gerd Hoffmann
2012-06-21 10:04   ` Peter Maydell
2012-06-21 10:27     ` Andreas Färber
2012-06-21 11:28       ` Dor Laor

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=1340196107-6309-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).