mirror of https://github.com/xemu-project/xemu.git
ehci: Handle USB_RET_PROCERR in ehci_fill_queue
USB_RET_PROCERR can be triggered by the guest (by for example requesting more then BUFFSIZE bytes), so don't assert on it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
ef5b234477
commit
eff6dce79b
|
@ -2076,7 +2076,7 @@ static int ehci_state_horizqh(EHCIQueue *q)
|
||||||
return again;
|
return again;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ehci_fill_queue(EHCIPacket *p)
|
static int ehci_fill_queue(EHCIPacket *p)
|
||||||
{
|
{
|
||||||
EHCIQueue *q = p->queue;
|
EHCIQueue *q = p->queue;
|
||||||
EHCIqtd qtd = p->qtd;
|
EHCIqtd qtd = p->qtd;
|
||||||
|
@ -2100,9 +2100,13 @@ static void ehci_fill_queue(EHCIPacket *p)
|
||||||
p->qtdaddr = qtdaddr;
|
p->qtdaddr = qtdaddr;
|
||||||
p->qtd = qtd;
|
p->qtd = qtd;
|
||||||
p->usb_status = ehci_execute(p, "queue");
|
p->usb_status = ehci_execute(p, "queue");
|
||||||
|
if (p->usb_status == USB_RET_PROCERR) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
assert(p->usb_status == USB_RET_ASYNC);
|
assert(p->usb_status == USB_RET_ASYNC);
|
||||||
p->async = EHCI_ASYNC_INFLIGHT;
|
p->async = EHCI_ASYNC_INFLIGHT;
|
||||||
}
|
}
|
||||||
|
return p->usb_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ehci_state_execute(EHCIQueue *q)
|
static int ehci_state_execute(EHCIQueue *q)
|
||||||
|
@ -2144,8 +2148,7 @@ static int ehci_state_execute(EHCIQueue *q)
|
||||||
trace_usb_ehci_packet_action(p->queue, p, "async");
|
trace_usb_ehci_packet_action(p->queue, p, "async");
|
||||||
p->async = EHCI_ASYNC_INFLIGHT;
|
p->async = EHCI_ASYNC_INFLIGHT;
|
||||||
ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH);
|
ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH);
|
||||||
again = 1;
|
again = (ehci_fill_queue(p) == USB_RET_PROCERR) ? -1 : 1;
|
||||||
ehci_fill_queue(p);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue