ehci: check for EHCI_ASYNC_FINISHED first in ehci_free_packet
Otherwise we'll see the packet free twice in the trace log even though it actually happens only once. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
4b63a0df3b
commit
616789cde2
@ -747,12 +747,6 @@ static EHCIPacket *ehci_alloc_packet(EHCIQueue *q)
|
|||||||
|
|
||||||
static void ehci_free_packet(EHCIPacket *p)
|
static void ehci_free_packet(EHCIPacket *p)
|
||||||
{
|
{
|
||||||
trace_usb_ehci_packet_action(p->queue, p, "free");
|
|
||||||
if (p->async == EHCI_ASYNC_INFLIGHT) {
|
|
||||||
usb_cancel_packet(&p->packet);
|
|
||||||
usb_packet_unmap(&p->packet, &p->sgl);
|
|
||||||
qemu_sglist_destroy(&p->sgl);
|
|
||||||
}
|
|
||||||
if (p->async == EHCI_ASYNC_FINISHED) {
|
if (p->async == EHCI_ASYNC_FINISHED) {
|
||||||
int state = ehci_get_state(p->queue->ehci, p->queue->async);
|
int state = ehci_get_state(p->queue->ehci, p->queue->async);
|
||||||
/* This is a normal, but rare condition (cancel racing completion) */
|
/* This is a normal, but rare condition (cancel racing completion) */
|
||||||
@ -763,6 +757,12 @@ static void ehci_free_packet(EHCIPacket *p)
|
|||||||
/* state_writeback recurses into us with async == EHCI_ASYNC_NONE!! */
|
/* state_writeback recurses into us with async == EHCI_ASYNC_NONE!! */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
trace_usb_ehci_packet_action(p->queue, p, "free");
|
||||||
|
if (p->async == EHCI_ASYNC_INFLIGHT) {
|
||||||
|
usb_cancel_packet(&p->packet);
|
||||||
|
usb_packet_unmap(&p->packet, &p->sgl);
|
||||||
|
qemu_sglist_destroy(&p->sgl);
|
||||||
|
}
|
||||||
QTAILQ_REMOVE(&p->queue->packets, p, next);
|
QTAILQ_REMOVE(&p->queue->packets, p, next);
|
||||||
usb_packet_cleanup(&p->packet);
|
usb_packet_cleanup(&p->packet);
|
||||||
g_free(p);
|
g_free(p);
|
||||||
|
Loading…
Reference in New Issue
Block a user