dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

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

Hans de Goede c8dfc6
From d0c16c3cd8dc1f2dc5ca6dae0d09e5f066332531 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
Hans de Goede c8dfc6
Subject: [PATCH 304/366] usb-core: Allow the first packet of a pipelined ep
Hans de Goede c8dfc6
 to 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>
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
-- 
Hans de Goede c8dfc6
1.7.12
Hans de Goede c8dfc6