[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/36] ehci: Detect going in circles when filling th
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 07/36] ehci: Detect going in circles when filling the queue |
Date: |
Thu, 25 Oct 2012 14:51:40 +0200 |
From: Hans de Goede <address@hidden>
For ctrl endpoints Windows (atleast Win7) creates circular td lists, so far
these were not a problem because we would stop filling the queue if altnext
was set. Since further patches in this patchset remove the altnext check this
does become a problem and we need detection for going in circles.
Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index d600f08..8bd87c7 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2073,7 +2073,7 @@ static int ehci_fill_queue(EHCIPacket *p)
{
EHCIQueue *q = p->queue;
EHCIqtd qtd = p->qtd;
- uint32_t qtdaddr;
+ uint32_t qtdaddr, start_addr = p->qtdaddr;
for (;;) {
if (NLPTR_TBIT(qtd.altnext) == 0) {
@@ -2083,6 +2083,13 @@ static int ehci_fill_queue(EHCIPacket *p)
break;
}
qtdaddr = qtd.next;
+ /*
+ * Detect circular td lists, Windows creates these, counting on the
+ * active bit going low after execution to make the queue stop.
+ */
+ if (qtdaddr == start_addr) {
+ break;
+ }
get_dwords(q->ehci, NLPTR_GET(qtdaddr),
(uint32_t *) &qtd, sizeof(EHCIqtd) >> 2);
ehci_trace_qtd(q, NLPTR_GET(qtdaddr), &qtd);
--
1.7.1
- [Qemu-devel] [PATCH 17/36] uhci: cleanup: Add an unlink call to uhci_async_cancel(), (continued)
- [Qemu-devel] [PATCH 17/36] uhci: cleanup: Add an unlink call to uhci_async_cancel(), Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 25/36] uhci: Immediately free queues on device disconnect, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 14/36] usb: Add an int_req flag to USBPacket, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 36/36] xhci: fix usb name in caps, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 23/36] uhci: Make uhci_fill_queue() actually operate on an UHCIQueue, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 05/36] ehci: Improve latency of interrupt delivery and async schedule scanning, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 24/36] uhci: Store ep in UHCIQueue, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 19/36] uhci: Drop unnecessary forward declaration of some static functions, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 26/36] uhci: Verify queue has not been changed by guest, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 09/36] xhci: Add a xhci_ep_nuke_one_xfer helper function, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 07/36] ehci: Detect going in circles when filling the queue,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 04/36] ehci: Set int flag on a short input packet, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 22/36] uhci: Add uhci_read_td() helper function, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 31/36] uhci: Use only one queue for ctrl endpoints, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 30/36] uhci: Retry to fill the queue while waiting for td completion, Gerd Hoffmann, 2012/10/25
- [Qemu-devel] [PATCH 35/36] xhci: make number of interrupters and slots configurable, Gerd Hoffmann, 2012/10/25
- Re: [Qemu-devel] [PULL 00/36] usb patch queue, Anthony Liguori, 2012/10/29