Blame 0304-usb-core-Allow-the-first-packet-of-a-pipelined-ep-to.patch

c8dfc6
From d0c16c3cd8dc1f2dc5ca6dae0d09e5f066332531 Mon Sep 17 00:00:00 2001
c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Date: Mon, 3 Sep 2012 12:48:49 +0200
c8dfc6
Subject: [PATCH 304/366] usb-core: Allow the first packet of a pipelined ep
c8dfc6
 to complete immediately
c8dfc6
c8dfc6
This can happen with usb-redir live-migration when the packet gets re-queued
c8dfc6
after the migration and the original queuing from the migration source side
c8dfc6
has already finished.
c8dfc6
c8dfc6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
c8dfc6
---
c8dfc6
 hw/usb/core.c | 2 +-
c8dfc6
 1 file changed, 1 insertion(+), 1 deletion(-)
c8dfc6
c8dfc6
diff --git a/hw/usb/core.c b/hw/usb/core.c
c8dfc6
index fe431d0..b9f1f7a 100644
c8dfc6
--- a/hw/usb/core.c
c8dfc6
+++ b/hw/usb/core.c
c8dfc6
@@ -398,7 +398,7 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
c8dfc6
              * When pipelining is enabled usb-devices must always return async,
c8dfc6
              * otherwise packets can complete out of order!
c8dfc6
              */
c8dfc6
-            assert(!p->ep->pipeline);
c8dfc6
+            assert(!p->ep->pipeline || QTAILQ_EMPTY(&p->ep->queue));
c8dfc6
             if (ret != USB_RET_NAK) {
c8dfc6
                 p->result = ret;
c8dfc6
                 usb_packet_set_state(p, USB_PACKET_COMPLETE);
c8dfc6
-- 
c8dfc6
1.7.12
c8dfc6