From: Gerd Hoffmann <kraxel@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] xhci migration breakage
Date: Fri, 31 Mar 2017 07:45:33 +0200 [thread overview]
Message-ID: <1490939133.1877.3.camel@redhat.com> (raw)
In-Reply-To: <20170330174242.GM2800@work-vm>
[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]
Hi,
> dest:
> (qemu) red_dispatcher_loadvm_commands:
> usb-storage msd post_load 0x7f45f510ee50 sig=0 tag=0
>
> I added these as debug on the 'usb-storage' vmsd element; but
> the signature/tag being 0 I assume they're not the culprit.
Yep, no inflight transfer, so highly unlikely (also note that ehci works
fine according to bugzilla).
> #6 0x00007febabacae27 in xhci_kick_epctx (epctx=<optimized out>, xfer=<optimized out>, xhci=<optimized out>)
> at /root/1436616/qemu/hw/usb/hcd-xhci.c:2103 <- right at the end of xhci_submit
> #7 0x00007febabacae27 in xhci_kick_epctx (epctx=<optimized out>, xfer=<optimized out>, xhci=<optimized out>)
> at /root/1436616/qemu/hw/usb/hcd-xhci.c:2112 right at end of xhci_fire_transfer
> #8 0x00007febabacae27 in xhci_kick_epctx (epctx=0x7febaec395a0, streamid=0)
> at /root/1436616/qemu/hw/usb/hcd-xhci.c:2240
Recursive xhci_kick_epctx calls, not good.
Does the attached patch (not tested yet) make any difference?
cheers,
Gerd
[-- Attachment #2: 0001-xhci-set-kick_active-for-retried-xfers-too.patch --]
[-- Type: text/x-patch, Size: 2779 bytes --]
From 1b10b10445ab438c3fa1107f9962add3ae0716c6 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 31 Mar 2017 07:40:45 +0200
Subject: [PATCH] xhci: set kick_active for retried xfers too
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/hcd-xhci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index f0af852..8958f95 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2083,6 +2083,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
return;
}
+ epctx->kick_active++;
if (epctx->retry) {
XHCITransfer *xfer = epctx->retry;
@@ -2093,6 +2094,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
mfindex = xhci_mfindex_get(xhci);
xhci_check_intr_iso_kick(xhci, xfer, epctx, mfindex);
if (xfer->running_retry) {
+ epctx->kick_active--;
return;
}
xfer->timed_xfer = 0;
@@ -2101,6 +2103,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
if (xfer->iso_xfer) {
/* retry iso transfer */
if (xhci_setup_packet(xfer) < 0) {
+ epctx->kick_active--;
return;
}
usb_handle_packet(xfer->packet.ep->dev, &xfer->packet);
@@ -2109,10 +2112,12 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
} else {
/* retry nak'ed transfer */
if (xhci_setup_packet(xfer) < 0) {
+ epctx->kick_active--;
return;
}
usb_handle_packet(xfer->packet.ep->dev, &xfer->packet);
if (xfer->packet.status == USB_RET_NAK) {
+ epctx->kick_active--;
return;
}
xhci_try_complete_packet(xfer);
@@ -2126,6 +2131,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
if (epctx->state == EP_HALTED) {
DPRINTF("xhci: ep halted, not running schedule\n");
+ epctx->kick_active--;
return;
}
@@ -2134,6 +2140,7 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
uint32_t err;
stctx = xhci_find_stream(epctx, streamid, &err);
if (stctx == NULL) {
+ epctx->kick_active--;
return;
}
ring = &stctx->ring;
@@ -2145,7 +2152,6 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid)
}
assert(ring->dequeue != 0);
- epctx->kick_active++;
while (1) {
length = xhci_ring_chain_length(xhci, ring);
if (length <= 0) {
--
1.8.3.1
next prev parent reply other threads:[~2017-03-31 5:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-30 12:23 [Qemu-devel] xhci migration breakage Dr. David Alan Gilbert
2017-03-30 14:10 ` Gerd Hoffmann
2017-03-30 17:42 ` Dr. David Alan Gilbert
2017-03-31 5:45 ` Gerd Hoffmann [this message]
2017-03-31 8:54 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1490939133.1877.3.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.