Skip to contentSkip to conversation

usb: xhci: break loop after ctrl transfer complete

PATCH In review P J P 2 participants 2 messages Feb 13, 2017

lore
Share & tools
lore

P J P

author
#0 lore raw

PATCH 1/1 usb: xhci: break loop after ctrl transfer complete

From: Prasad J Pandit <[email protected]>

xHCI controller emulator loops through the transfer ring to transfer control/data between host memory and device endpoints. It continues to do so after processing 'Status Stage' TD which is the last descriptor in control transfer. Add break to avoid infinite loop.

---
 hw/usb/hcd-xhci.c | 1 +
 1 file changed, 1 insertion(+)
hw/usb/hcd-xhci.c +1 -0
index 54b3901..7e2d345 100644
@@ -2252,6 +2252,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
         if (xfer->complete) {
             xhci_ep_free_xfer(xfer);
             xfer = NULL;
+            break;
         }
 
         if (epctx->state == EP_HALTED) {
Signature · 1 line
2.9.3
#1 lore raw
Quoted 6 lines · P J P

From: Prasad J Pandit <[email protected]>

xHCI controller emulator loops through the transfer ring to transfer control/data between host memory and device endpoints. It continues to do so after processing 'Status Stage' TD which is the last descriptor in control transfer.

That is perfectly fine. The guest is allowed to queue up multiple requests.

Quoted 2 lines

Add break to avoid
infinite loop.

It's not that simple.

https://patchwork.ozlabs.org/patch/724484/

cheers,
Gerd