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