[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/54] ehci: Handle USB_RET_PROCERR in ehci_fill_que
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 15/54] ehci: Handle USB_RET_PROCERR in ehci_fill_queue |
Date: |
Thu, 6 Sep 2012 09:12:16 +0200 |
From: Hans de Goede <address@hidden>
USB_RET_PROCERR can be triggered by the guest (by for example requesting more
then BUFFSIZE bytes), so don't assert on it.
Signed-off-by: Hans de Goede <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-ehci.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index d87aca8..2534394 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2076,7 +2076,7 @@ static int ehci_state_horizqh(EHCIQueue *q)
return again;
}
-static void ehci_fill_queue(EHCIPacket *p)
+static int ehci_fill_queue(EHCIPacket *p)
{
EHCIQueue *q = p->queue;
EHCIqtd qtd = p->qtd;
@@ -2100,9 +2100,13 @@ static void ehci_fill_queue(EHCIPacket *p)
p->qtdaddr = qtdaddr;
p->qtd = qtd;
p->usb_status = ehci_execute(p, "queue");
+ if (p->usb_status == USB_RET_PROCERR) {
+ break;
+ }
assert(p->usb_status == USB_RET_ASYNC);
p->async = EHCI_ASYNC_INFLIGHT;
}
+ return p->usb_status;
}
static int ehci_state_execute(EHCIQueue *q)
@@ -2144,8 +2148,7 @@ static int ehci_state_execute(EHCIQueue *q)
trace_usb_ehci_packet_action(p->queue, p, "async");
p->async = EHCI_ASYNC_INFLIGHT;
ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH);
- again = 1;
- ehci_fill_queue(p);
+ again = (ehci_fill_queue(p) == USB_RET_PROCERR) ? -1 : 1;
goto out;
}
--
1.7.1
- [Qemu-devel] [PATCH 28/54] usb-redir: Enable pipelining for bulk endpoints, (continued)
- [Qemu-devel] [PATCH 28/54] usb-redir: Enable pipelining for bulk endpoints, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 41/54] usb3: superspeed descriptors, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 44/54] usb-storage: usb3 support, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 25/54] usb-redir: Set ep max_packet_size if available, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 30/54] usb-audio: fix usb version, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 43/54] usb3: bos decriptor, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 52/54] xhci: support multiple interrupters, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 21/54] usb-redir: Get rid of unused async-struct dev member, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 27/54] usb-redir: Ensure our peer has the necessary caps when redirecting to XHCI, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 24/54] usb-redir: Convert to new libusbredirparser 0.5 API, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 15/54] ehci: Handle USB_RET_PROCERR in ehci_fill_queue,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 18/54] usb-redir: Don't delay handling of open events to a bottom half, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 23/54] usb-redir: Return babble when getting more bulk data then requested, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 20/54] usb-redir: Get rid of local shadow copy of packet headers, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 37/54] xhci: add trace_usb_xhci_ep_set_dequeue, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 33/54] xhci: move device lookup into xhci_setup_packet, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 09/54] ehci: Properly report completed but not yet processed packets to the guest, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 36/54] xhci: trace cc codes in cleartext, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 38/54] xhci: fix runtime write tracepoint, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 31/54] xhci: rip out background transfer code, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 42/54] usb3: superspeed endpoint companion, Gerd Hoffmann, 2012/09/06