From patchwork Tue Oct 11 07:35:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 118875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 169F7B6F70 for ; Tue, 11 Oct 2011 18:35:31 +1100 (EST) Received: from localhost ([::1]:43065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDWs2-0005HF-GU for incoming@patchwork.ozlabs.org; Tue, 11 Oct 2011 03:35:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDWrw-0005H3-GK for qemu-devel@nongnu.org; Tue, 11 Oct 2011 03:35:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDWrr-00065d-VE for qemu-devel@nongnu.org; Tue, 11 Oct 2011 03:35:20 -0400 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:43871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDWrr-000657-ME for qemu-devel@nongnu.org; Tue, 11 Oct 2011 03:35:15 -0400 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9B7ZDvV006977 for ; Tue, 11 Oct 2011 07:35:13 GMT Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9B7ZCBv2412554 for ; Tue, 11 Oct 2011 08:35:13 +0100 Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9B7ZCMD032229 for ; Tue, 11 Oct 2011 08:35:12 +0100 Received: from BR8GGW75.de.ibm.com (dyn-9-152-221-25.boeblingen.de.ibm.com [9.152.221.25]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p9B7ZCJR032223; Tue, 11 Oct 2011 08:35:12 +0100 Date: Tue, 11 Oct 2011 09:35:11 +0200 From: Thomas Huth To: qemu-devel@nongnu.org Message-ID: <20111011093511.03741ed6@BR8GGW75.de.ibm.com> In-Reply-To: <20111010150341.35f19e79@BR8GGW75.de.ibm.com> References: <20111010150341.35f19e79@BR8GGW75.de.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.196.100.167 Cc: Gerd Hoffmann Subject: Re: [Qemu-devel] [BUG] USB assertion triggers in usb_packet_complete() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am Mon, 10 Oct 2011 15:03:41 +0200 schrieb Thomas Huth : > > I am currently facing a problem when running QEMU (up-to-date git > version) with OHCI and a lot of virtual USB devices. > The emulator dies with the following assertion: > > qemu-system-arm: hw/usb.c:337: usb_packet_complete: > Assertion `p->owner != ((void *)0)' failed. Not sure whether this is the right solution, but this patch fixes the problem for me: Thomas diff --git a/hw/usb.c b/hw/usb.c index fa90204..7cef9e2 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -25,6 +25,7 @@ */ #include "qemu-common.h" #include "usb.h" +#include "usb-desc.h" #include "iov.h" void usb_attach(USBPort *port) @@ -334,7 +335,9 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p) void usb_packet_complete(USBDevice *dev, USBPacket *p) { /* Note: p->owner != dev is possible in case dev is a hub */ - assert(p->owner != NULL); + if (dev->device->bDeviceClass != USB_CLASS_HUB) { + assert(p->owner != NULL); + } p->owner = NULL; dev->port->ops->complete(dev->port, p); }