提交 c96c41ed 编写于 作者: G Gerd Hoffmann

usb: parallelize usb3 streams

usb3 bulk endpoints with streams are implicitly pipelined now,
so the requests will actually be processed in parallel.  Also
allow them to complete out-of-order.

Fixes stalls in the uas driver.

Cc: qemu-stable@nongnu.org
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 1556a8fc
...@@ -403,7 +403,7 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p) ...@@ -403,7 +403,7 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p)
p->ep->halted = false; p->ep->halted = false;
} }
if (QTAILQ_EMPTY(&p->ep->queue) || p->ep->pipeline) { if (QTAILQ_EMPTY(&p->ep->queue) || p->ep->pipeline || p->stream) {
usb_process_one(p); usb_process_one(p);
if (p->status == USB_RET_ASYNC) { if (p->status == USB_RET_ASYNC) {
/* hcd drivers cannot handle async for isoc */ /* hcd drivers cannot handle async for isoc */
...@@ -420,7 +420,8 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p) ...@@ -420,7 +420,8 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p)
* When pipelining is enabled usb-devices must always return async, * When pipelining is enabled usb-devices must always return async,
* otherwise packets can complete out of order! * otherwise packets can complete out of order!
*/ */
assert(!p->ep->pipeline || QTAILQ_EMPTY(&p->ep->queue)); assert(p->stream || !p->ep->pipeline ||
QTAILQ_EMPTY(&p->ep->queue));
if (p->status != USB_RET_NAK) { if (p->status != USB_RET_NAK) {
usb_packet_set_state(p, USB_PACKET_COMPLETE); usb_packet_set_state(p, USB_PACKET_COMPLETE);
} }
...@@ -434,7 +435,7 @@ void usb_packet_complete_one(USBDevice *dev, USBPacket *p) ...@@ -434,7 +435,7 @@ void usb_packet_complete_one(USBDevice *dev, USBPacket *p)
{ {
USBEndpoint *ep = p->ep; USBEndpoint *ep = p->ep;
assert(QTAILQ_FIRST(&ep->queue) == p); assert(p->stream || QTAILQ_FIRST(&ep->queue) == p);
assert(p->status != USB_RET_ASYNC && p->status != USB_RET_NAK); assert(p->status != USB_RET_ASYNC && p->status != USB_RET_NAK);
if (p->status != USB_RET_SUCCESS || if (p->status != USB_RET_SUCCESS ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册