[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/12] usb-ehci: fix offset writeback in ehci_buffer
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 09/12] usb-ehci: fix offset writeback in ehci_buffer_rw |
Date: |
Thu, 26 May 2011 12:44:11 +0200 |
Two bugs at once:
First the mask is backwards, so the it used to keeps the offset and
clears the page address, which is not what we need when we update the
offset.
Second the offset calculation is wrong in case head isn't page aligned.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb-ehci.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index 5cbb675..cf10dfc 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -1066,6 +1066,7 @@ static int ehci_buffer_rw(EHCIQueue *q, int bytes, int rw)
cpu_physical_memory_rw(head, q->buffer + bufpos, tail - head, rw);
bufpos += (tail - head);
+ offset += (tail - head);
bytes -= (tail - head);
if (bytes > 0) {
@@ -1078,8 +1079,7 @@ static int ehci_buffer_rw(EHCIQueue *q, int bytes, int rw)
set_field(&q->qh.token, cpage, QTD_TOKEN_CPAGE);
/* save offset into cpage */
- offset = tail - head;
- q->qh.bufptr[0] &= ~QTD_BUFPTR_MASK;
+ q->qh.bufptr[0] &= QTD_BUFPTR_MASK;
q->qh.bufptr[0] |= offset;
return 0;
--
1.7.1
- [Qemu-devel] [PATCH 00/12] ehci: tracing, multiqueue, bugfixes., Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 04/12] usb-ehci: trace port state, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 01/12] usb-linux: catch NODEV in more places., Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 02/12] usb-ehci: trace mmio and usbsts, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 03/12] usb-ehci: trace state machine changes, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 06/12] usb-ehci: trace buffer copy, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 09/12] usb-ehci: fix offset writeback in ehci_buffer_rw,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 05/12] usb-ehci: improve mmio tracing, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 10/12] usb-ehci: fix error handling., Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 11/12] ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6), Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 08/12] usb-ehci: multiqueue support, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 12/12] usb: cancel async packets on unplug, Gerd Hoffmann, 2011/05/26
- [Qemu-devel] [PATCH 07/12] usb-ehci: add queue data struct, Gerd Hoffmann, 2011/05/26