peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

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

5544c1
From 2a2b40b145764ece12d0872ae5bb7b7ec2dc271f Mon Sep 17 00:00:00 2001
Hans de Goede c8dfc6
From: Hans de Goede <hdegoede@redhat.com>
Hans de Goede 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
Hans de Goede c8dfc6
Hans de Goede c8dfc6
This can happen with usb-redir live-migration when the packet gets re-queued
Hans de Goede c8dfc6
after the migration and the original queuing from the migration source side
Hans de Goede c8dfc6
has already finished.
Hans de Goede c8dfc6
Hans de Goede c8dfc6
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede 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>
Hans de Goede c8dfc6
---
Hans de Goede c8dfc6
 hw/usb/core.c | 2 +-
Hans de Goede c8dfc6
 1 file changed, 1 insertion(+), 1 deletion(-)
Hans de Goede c8dfc6
Hans de Goede c8dfc6
diff --git a/hw/usb/core.c b/hw/usb/core.c
Hans de Goede c8dfc6
index fe431d0..b9f1f7a 100644
Hans de Goede c8dfc6
--- a/hw/usb/core.c
Hans de Goede c8dfc6
+++ b/hw/usb/core.c
Hans de Goede c8dfc6
@@ -398,7 +398,7 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p)
Hans de Goede c8dfc6
              * When pipelining is enabled usb-devices must always return async,
Hans de Goede c8dfc6
              * otherwise packets can complete out of order!
Hans de Goede c8dfc6
              */
Hans de Goede c8dfc6
-            assert(!p->ep->pipeline);
Hans de Goede c8dfc6
+            assert(!p->ep->pipeline || QTAILQ_EMPTY(&p->ep->queue));
Hans de Goede c8dfc6
             if (ret != USB_RET_NAK) {
Hans de Goede c8dfc6
                 p->result = ret;
Hans de Goede c8dfc6
                 usb_packet_set_state(p, USB_PACKET_COMPLETE);
Hans de Goede c8dfc6
-- 
5544c1
1.7.12.1
Hans de Goede c8dfc6