qemu/hw/usb
Hans de Goede e449f26bed ehci_free_packet: Discard finished packets when the queue is halted
With pipelining it is possible to encounter a finished packet when cleaning
the queue due to a halt. This happens when a non stall error happens while
talking to a real device. In this case the queue on the usb-host side will
continue processing packets, and we can have completed packets waiting in
the queue after an error condition packet causing a halt.

There are 2 reasons to discard the completed packets at this point, rather
then trying to writing them back to the guest:

1) The guest expect to be able to cancel and/or change packets after the
packet with the error without doing an unlink, so writing them back may
confuse the guest.

2) Since the queue does not advance when halted, the writing back of these
packets will fail anyways since p->qtdaddr != q->qtdaddr, so the
ehci_verify_qtd call in ehci_writeback_async_complete_packet will fail.

Note that 2) means that then only functional change this patch introduces
is the printing of a warning when this scenario happens.

Note that discarding these packets means that the guest driver and the device
will get out of sync! This is unfortunate, but should not be a problem since
with a non stall error (iow an io-error) the 2 are out of sync already anyways.
Still this patch adds a warning to signal this happening.

Note that sofar this has only been seen with a DVB-T receiver, which gives
of a MPEG-2 stream, which allows for recovering from lost packets, see:
https://bugzilla.redhat.com/show_bug.cgi?id=890320

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-04-23 08:43:10 +02:00
..
bus.c usb-hub: limit chain length 2013-04-03 11:39:43 +02:00
ccid-card-emulated.c sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
ccid-card-passthru.c sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
ccid.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
combined-packet.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
core.c usb-core: usb3 streams 2013-02-19 12:30:05 +01:00
desc.c usb: fix endpoint descriptor ordering 2013-02-19 12:30:05 +01:00
desc.h usb: split packet result into actual_length + status 2012-11-08 18:41:46 +01:00
dev-audio.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
dev-bluetooth.c sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
dev-hid.c Merge remote-tracking branch 'bonzini/hw-dirs' into staging 2013-04-08 13:12:33 -05:00
dev-hub.c usb-hub: report status changes only once 2013-04-03 11:39:43 +02:00
dev-network.c hw: move qdev-monitor.o to toplevel directory 2013-03-01 13:54:10 +01:00
dev-serial.c usb-serial: Remove double call to qemu_chr_add_handlers( NULL ) 2013-04-16 11:59:08 +02:00
dev-smartcard-reader.c hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
dev-storage.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
dev-uas.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
dev-wacom.c usb-core: usb3 streams 2013-02-19 12:30:05 +01:00
hcd-ehci-pci.c usb/ehci: Clean up SysBus and PCI EHCI split 2013-01-07 12:57:24 +01:00
hcd-ehci-sysbus.c usb/ehci: Add SysBus EHCI device for Exynos4210 2013-01-07 12:57:24 +01:00
hcd-ehci.c ehci_free_packet: Discard finished packets when the queue is halted 2013-04-23 08:43:10 +02:00
hcd-ehci.h usb/ehci: Add SysBus EHCI device for Exynos4210 2013-01-07 12:57:24 +01:00
hcd-musb.c usb-core: usb3 streams 2013-02-19 12:30:05 +01:00
hcd-ohci.c usb-core: usb3 streams 2013-02-19 12:30:05 +01:00
hcd-uhci.c usb-core: usb3 streams 2013-02-19 12:30:05 +01:00
hcd-xhci.c xhci: remove XHCIRing->base (unused) 2013-04-23 08:43:10 +02:00
host-bsd.c usb-host: remove usb_host_device_close 2013-02-19 12:30:05 +01:00
host-legacy.c usb-host: move legacy cmd line bits 2013-02-19 12:30:05 +01:00
host-libusb.c use libusb for usb-host 2013-04-16 12:04:09 +02:00
host-linux.c use libusb for usb-host 2013-04-16 12:04:09 +02:00
host-stub.c usb-host: remove usb_host_device_close 2013-02-19 12:30:05 +01:00
host.h usb-host: move legacy cmd line bits 2013-02-19 12:30:05 +01:00
libhw.c include: avoid useless includes of exec/ headers 2013-04-15 18:19:26 +02:00
Makefile.objs hw: make all of hw/usb/ configurable via default-configs/ 2013-04-08 18:13:12 +02:00
quirks-ftdi-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks-pl2303-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks.c usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
redirect.c sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00