qemu-e2k/hw/usb
Hans de Goede 7f102ebeb5 uhci: Don't crash on device disconnect
My recent uhci cleanup series has introduced a regression, where
qemu sometimes crashes on a device disconnect. The problem is that
the uhci code never checked for a device not / no longer existing, instead
it was relying on usb_handle_packet accepting a NULL device.

But since we now pass usb_handle_packet q->ep->dev, rather then just
a local dev variable, we crash as q->ep == NULL due to the device no longer
existing.

This patch fixes this. Note that this patch also improves over
the old behavior were we would:
1) create a queue for the device
2) create an async for the packet
3) have usb_handle_packet fail
4) destroy the async
5) wait for the queue to be idle for 32 frames
6) destroy the queue

Which was rather sub-optimal.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-01 15:17:58 +01:00
..
bus.c usb: Add USB_RET_ADD_TO_QUEUE packet result code 2012-10-25 09:08:09 +02:00
core.c usb: Enforce iso endpoints never returing USB_RET_ASYNC 2012-10-25 09:08:10 +02:00
desc.c
desc.h
dev-audio.c
dev-bluetooth.c
dev-hid.c
dev-hub.c
dev-network.c
dev-serial.c usb-serial: only expose device in guest when the chardev is open 2012-10-22 13:26:42 -05:00
dev-smartcard-reader.c
dev-storage.c
dev-uas.c cleanup useless return sentence 2012-10-05 15:10:21 +02:00
dev-wacom.c
hcd-ehci-pci.c usb/ehci-pci: add helper to create ich9 usb controllers 2012-11-01 15:17:58 +01:00
hcd-ehci-sysbus.c usb/ehci: add sysbus variant 2012-11-01 13:10:10 +01:00
hcd-ehci.c usb/ehci: split into multiple source files 2012-11-01 13:10:10 +01:00
hcd-ehci.h usb/ehci: split into multiple source files 2012-11-01 13:10:10 +01:00
hcd-musb.c usb: Add an int_req flag to USBPacket 2012-10-25 09:08:10 +02:00
hcd-ohci.c usb: Add an int_req flag to USBPacket 2012-10-25 09:08:10 +02:00
hcd-uhci.c uhci: Don't crash on device disconnect 2012-11-01 15:17:58 +01:00
hcd-xhci.c xhci: allow address slot being called multiple times 2012-11-01 13:10:09 +01:00
host-bsd.c
host-linux.c usb: Move short-not-ok handling to the core 2012-10-25 09:08:10 +02:00
host-stub.c
libhw.c usb: Fix usb_packet_map() in the presence of IOMMUs 2012-09-26 09:24:42 +02:00
Makefile.objs usb/ehci: add sysbus variant 2012-11-01 13:10:10 +01:00
redirect.c usb: Move short-not-ok handling to the core 2012-10-25 09:08:10 +02:00