qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] usb: xhci: break loop after ctrl transfer complete
@ 2017-02-13  7:55 P J P
  2017-02-13 13:28 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: P J P @ 2017-02-13  7:55 UTC (permalink / raw)
  To: Qemu Developers; +Cc: Gerd Hoffmann, Li Qiang, Prasad J Pandit

From: Prasad J Pandit <pjp@fedoraproject.org>

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.

Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
 hw/usb/hcd-xhci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 54b3901..7e2d345 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -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) {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] usb: xhci: break loop after ctrl transfer complete
  2017-02-13  7:55 [Qemu-devel] [PATCH] usb: xhci: break loop after ctrl transfer complete P J P
@ 2017-02-13 13:28 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2017-02-13 13:28 UTC (permalink / raw)
  To: P J P; +Cc: Qemu Developers, Li Qiang, Prasad J Pandit

On Mo, 2017-02-13 at 13:25 +0530, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
> 
> 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.

> Add break to avoid
> infinite loop.

It's not that simple.

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

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-13 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-13  7:55 [Qemu-devel] [PATCH] usb: xhci: break loop after ctrl transfer complete P J P
2017-02-13 13:28 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).