diff mbox

usb: Remove obsolete assert from usb_packet_complete

Message ID 4FEDD75A.1010705@siemens.com
State New
Headers show

Commit Message

Jan Kiszka June 29, 2012, 4:27 p.m. UTC
Due to queuing/pipelining, there can now be multiple packets per
endpoint in flight. So the assertion in usb_packet_complete became wrong
and can cause bogus QEMU terminations. Seen with a passed-through USB
headset.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

I'm not 100% sure that the assertion that the assertion is no longer
needed is actually correct. However, things work fine here without it.

 hw/usb/core.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Comments

Gerd Hoffmann July 2, 2012, 11:08 a.m. UTC | #1
On 06/29/12 18:27, Jan Kiszka wrote:
> Due to queuing/pipelining, there can now be multiple packets per
> endpoint in flight. So the assertion in usb_packet_complete became wrong
> and can cause bogus QEMU terminations. Seen with a passed-through USB
> headset.

NAK.  The assert doesn't protect against multiple packets in flight, but
against packet reorderng.

Need to understand why to assert actually triggers.

cheers,
  Gerd
diff mbox

Patch

diff --git a/hw/usb/core.c b/hw/usb/core.c
index 0e02da7..f4e4bbf 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -407,7 +407,6 @@  void usb_packet_complete(USBDevice *dev, USBPacket *p)
     int ret;
 
     usb_packet_check_state(p, USB_PACKET_ASYNC);
-    assert(QTAILQ_FIRST(&ep->queue) == p);
     usb_packet_set_state(p, USB_PACKET_COMPLETE);
     QTAILQ_REMOVE(&ep->queue, p, queue);
     dev->port->ops->complete(dev->port, p);