Message ID | 4FF1AF8C.5030400@siemens.com |
---|---|
State | New |
Headers | show |
> diff --git a/hw/usb/core.c b/hw/usb/core.c > index 0e02da7..eacda74 100644 > --- a/hw/usb/core.c > +++ b/hw/usb/core.c > @@ -407,7 +407,9 @@ void usb_packet_complete(USBDevice *dev, USBPacket *p) > int ret; > > usb_packet_check_state(p, USB_PACKET_ASYNC); > - assert(QTAILQ_FIRST(&ep->queue) == p); > + if (QTAILQ_FIRST(&ep->queue) != p) { > + trace_usb_assert(usb_bus_from_device(dev)->busnr, dev->port->path, p->ep->nr, p); > + } Can you also log QTAILQ_FIRST(&ep->queue) there? usb_host_* & usb_packet_state_* tracepoints are good to have, usb_uhci_* is not needed. From the trace it looks like the packets are completing in the same order they have been submitted as they should, I'm puzzled why the assert triggers ... Can I also get a "lsusb -v" for the usb device in question? cheers, Gerd
On 07/02/12 17:47, Gerd Hoffmann wrote: >> diff --git a/hw/usb/core.c b/hw/usb/core.c >> index 0e02da7..eacda74 100644 >> --- a/hw/usb/core.c >> +++ b/hw/usb/core.c >> @@ -407,7 +407,9 @@ void usb_packet_complete(USBDevice *dev, USBPacket *p) >> int ret; >> >> usb_packet_check_state(p, USB_PACKET_ASYNC); >> - assert(QTAILQ_FIRST(&ep->queue) == p); >> + if (QTAILQ_FIRST(&ep->queue) != p) { >> + trace_usb_assert(usb_bus_from_device(dev)->busnr, dev->port->path, p->ep->nr, p); >> + } > > Can you also log QTAILQ_FIRST(&ep->queue) there? Oh, I think I've found it. It's most likely NULL. > Can I also get a "lsusb -v" for the usb device in question? Would still be useful. thanks, Gerd
diff --git a/hw/usb/core.c b/hw/usb/core.c index 0e02da7..eacda74 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -407,7 +407,9 @@ void usb_packet_complete(USBDevice *dev, USBPacket *p) int ret; usb_packet_check_state(p, USB_PACKET_ASYNC); - assert(QTAILQ_FIRST(&ep->queue) == p); + if (QTAILQ_FIRST(&ep->queue) != p) { + trace_usb_assert(usb_bus_from_device(dev)->busnr, dev->port->path, p->ep->nr, p); + } usb_packet_set_state(p, USB_PACKET_COMPLETE); QTAILQ_REMOVE(&ep->queue, p, queue); dev->port->ops->complete(dev->port, p); diff --git a/trace-events b/trace-events index c935ba2..a953898 100644 --- a/trace-events +++ b/trace-events @@ -230,6 +230,7 @@ sun4m_iommu_bad_addr(uint64_t addr) "bad addr %"PRIx64 # hw/usb/core.c usb_packet_state_change(int bus, const char *port, int ep, void *p, const char *o, const char *n) "bus %d, port %s, ep %d, packet %p, state %s -> %s" usb_packet_state_fault(int bus, const char *port, int ep, void *p, const char *o, const char *n) "bus %d, port %s, ep %d, packet %p, state %s, expected %s" +usb_assert(int bus, const char *port, int ep, void *p) "bus %d, port %s, ep %d, packet %p" # hw/usb/bus.c usb_port_claim(int bus, const char *port) "bus %d, port %s"