From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 9/9] usb-hub: don't trigger assert on packet completion.
Date: Thu, 13 Oct 2011 13:08:31 +0200 [thread overview]
Message-ID: <1318504111-15309-10-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1318504111-15309-1-git-send-email-kraxel@redhat.com>
Calling usb_packet_complete() recursively when passing up the completion
event up the chain for devices connected via usb hub will trigger an
assert. So don't do that, make the usb hub emulation call the upstream
completion callback directly instead.
Based on a patch from Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-hub.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 39382c7..dab8f51 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -207,10 +207,14 @@ static void usb_hub_complete(USBPort *port, USBPacket *packet)
/*
* Just pass it along upstream for now.
*
- * If we ever inplement usb 2.0 split transactions this will
+ * If we ever implement usb 2.0 split transactions this will
* become a little more complicated ...
+ *
+ * Can't use usb_packet_complete() here because packet->owner is
+ * cleared already, go call the ->complete() callback directly
+ * instead.
*/
- usb_packet_complete(&s->dev, packet);
+ s->dev.port->ops->complete(&s->dev.port, packet);
}
static void usb_hub_handle_reset(USBDevice *dev)
--
1.7.1
next prev parent reply other threads:[~2011-10-13 11:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 11:08 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 1/9] usb-storage: fix NULL pointer dereference Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 2/9] usb-hub: need to check dev->attached Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 3/9] usb: fix port reset Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 4/9] usb-host: factor out code Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 5/9] usb-host: handle USBDEVFS_SETCONFIGURATION returning EBUSY Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 6/9] hw/usb-ohci: Fix OHCI_TD_T1 bit position definition Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 7/9] hw/usb-ohci: Honour endpoint maximum packet size Gerd Hoffmann
2011-10-13 11:08 ` [Qemu-devel] [PATCH 8/9] usb-hid: activate usb tablet / mouse after migration Gerd Hoffmann
2011-10-13 11:08 ` Gerd Hoffmann [this message]
2011-10-13 11:34 ` [Qemu-devel] [PATCH 9/9] usb-hub: don't trigger assert on packet completion Gerd Hoffmann
2011-10-14 16:25 ` [Qemu-devel] [PULL] usb patch queue Anthony Liguori
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=1318504111-15309-10-git-send-email-kraxel@redhat.com \
--to=kraxel@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 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).