[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/21] usb-uhci: queuing fix
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 03/21] usb-uhci: queuing fix |
Date: |
Tue, 17 Apr 2012 10:45:08 +0200 |
When we queue up usb packets we may happen to find a already queued
packet, which also might be finished at that point already. We don't
want continue processing the packet at this point though, so lets
just signal back we've found a in-flight packet when in queuing mode.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-uhci.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 2be564b..266d550 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -795,7 +795,8 @@ out:
return TD_RESULT_NEXT_QH;
}
-static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td, uint32_t
*int_mask)
+static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td,
+ uint32_t *int_mask, bool queuing)
{
UHCIAsync *async;
int len = 0, max_len;
@@ -814,6 +815,12 @@ static int uhci_handle_td(UHCIState *s, uint32_t addr,
UHCI_TD *td, uint32_t *in
if (!async->done)
return TD_RESULT_ASYNC_CONT;
+ if (queuing) {
+ /* we are busy filling the queue, we are not prepared
+ to consume completed packages then, just leave them
+ in async state */
+ return TD_RESULT_ASYNC_CONT;
+ }
uhci_async_unlink(async);
goto done;
@@ -964,7 +971,7 @@ static void uhci_fill_queue(UHCIState *s, UHCI_TD *td)
break;
}
trace_usb_uhci_td_queue(plink & ~0xf, ptd.ctrl, ptd.token);
- ret = uhci_handle_td(s, plink, &ptd, &int_mask);
+ ret = uhci_handle_td(s, plink, &ptd, &int_mask, true);
if (ret == TD_RESULT_ASYNC_CONT) {
break;
}
@@ -1048,7 +1055,7 @@ static void uhci_process_frame(UHCIState *s)
trace_usb_uhci_td_load(curr_qh & ~0xf, link & ~0xf, td.ctrl, td.token);
old_td_ctrl = td.ctrl;
- ret = uhci_handle_td(s, link, &td, &int_mask);
+ ret = uhci_handle_td(s, link, &td, &int_mask, false);
if (old_td_ctrl != td.ctrl) {
/* update the status bits of the TD */
val = cpu_to_le32(td.ctrl);
--
1.7.1
- [Qemu-devel] [PULL 00/21] usb patch queue, Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 03/21] usb-uhci: queuing fix,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 05/21] usb-host: trace emulated requests, Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 17/21] usb: use USBDescriptor for endpoint descriptors., Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 01/21] usb/vmstate: add parent dev path, Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 11/21] usb-ehci: fix ehci_child_detach, Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 14/21] usb: use USBDescriptor for device qualifier descriptors., Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 10/21] usb-hub: add tracepoints, Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 18/21] usb-host: rewrite usb_linux_update_endp_table, Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 21/21] usb-ehci: drop assert(), Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 08/21] usb-host: add property to turn off pipelining, Gerd Hoffmann, 2012/04/17
- [Qemu-devel] [PATCH 19/21] usb-ehci: Drop unused sofv value, Gerd Hoffmann, 2012/04/17