Patchwork usb: Remove obsolete assert from usb_packet_complete

login
register
mail settings
Submitter Jan Kiszka
Date June 29, 2012, 4:27 p.m.
Message ID <4FEDD75A.1010705@siemens.com>
Download mbox | patch
Permalink /patch/168173/
State New
Headers show

Comments

Jan Kiszka - June 29, 2012, 4:27 p.m.
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(-)
Gerd Hoffmann - July 2, 2012, 11:08 a.m.
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

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);