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

5544c1
From 2a2b40b145764ece12d0872ae5bb7b7ec2dc271f 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
5544c1
Subject: [PATCH] usb-core: Allow the first packet of a pipelined ep to
5544c1
 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>
5544c1
(cherry picked from commit 9c1f67654ab611553bbfca54a1e0922728c25760)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.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
-- 
5544c1
1.7.12.1
c8dfc6