uhci: Immediately free queues on device disconnect
There is no need to just cancel any in-flight packets, and then wait for validate-end to clean things up, we can simply clean things up immediately on device removal. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
11d15e402b
commit
5ad23e873c
@ -281,16 +281,11 @@ static void uhci_async_validate_end(UHCIState *s)
|
|||||||
|
|
||||||
static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev)
|
static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev)
|
||||||
{
|
{
|
||||||
UHCIQueue *queue;
|
UHCIQueue *queue, *n;
|
||||||
UHCIAsync *curr, *n;
|
|
||||||
|
|
||||||
QTAILQ_FOREACH(queue, &s->queues, next) {
|
QTAILQ_FOREACH_SAFE(queue, &s->queues, next, n) {
|
||||||
QTAILQ_FOREACH_SAFE(curr, &queue->asyncs, next, n) {
|
if (queue->ep->dev == dev) {
|
||||||
if (!usb_packet_is_inflight(&curr->packet) ||
|
uhci_queue_free(queue, "cancel-device");
|
||||||
curr->packet.ep->dev != dev) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
uhci_async_cancel(curr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user