summary refs log tree commit diff stats
path: root/hw/usb/hcd-uhci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-03-21 18:25:25 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-04-17 10:23:27 +0200
commit52b0fecdba217e02d7e7eef975d942b153950b2f (patch)
treea3ad85305d76fcdea10c8b30135be0f35a4f37de /hw/usb/hcd-uhci.c
parenteeb0cf9abf5992f35eca18c4cc63300df30521a4 (diff)
downloadfocaccia-qemu-52b0fecdba217e02d7e7eef975d942b153950b2f.tar.gz
focaccia-qemu-52b0fecdba217e02d7e7eef975d942b153950b2f.zip
usb-uhci: stop queue filling when we find a in-flight td
Not only QHs can form rings, but TDs too.  With the new
queuing/pipelining support we are following TD chains and
can actually walk in circles.  An assert() prevents us from
entering an endless loop then.

Fix is easy:  Just stop queuing when we figure the TD we are
about to queue up is in flight already.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-uhci.c')
-rw-r--r--hw/usb/hcd-uhci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index e55dad914c..2be564b675 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -965,6 +965,9 @@ static void uhci_fill_queue(UHCIState *s, UHCI_TD *td)
         }
         trace_usb_uhci_td_queue(plink & ~0xf, ptd.ctrl, ptd.token);
         ret = uhci_handle_td(s, plink, &ptd, &int_mask);
+        if (ret == TD_RESULT_ASYNC_CONT) {
+            break;
+        }
         assert(ret == TD_RESULT_ASYNC_START);
         assert(int_mask == 0);
         plink = ptd.link;