From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LxIIF-0007xX-LH for qemu-devel@nongnu.org; Fri, 24 Apr 2009 06:06:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LxIIA-0007wn-GL for qemu-devel@nongnu.org; Fri, 24 Apr 2009 06:06:02 -0400 Received: from [199.232.76.173] (port=54174 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxIIA-0007wj-BT for qemu-devel@nongnu.org; Fri, 24 Apr 2009 06:05:58 -0400 Received: from smtp-out3.tiscali.nl ([195.241.79.178]:44752) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LxII9-0003Wn-MX for qemu-devel@nongnu.org; Fri, 24 Apr 2009 06:05:57 -0400 Subject: Re: [Qemu-devel] [BUG] -usb makes qemu fight against linux From: Paul Bolle In-Reply-To: <49B0E4C9.70002@sbeh.de> References: <49B0E4C9.70002@sbeh.de> Content-Type: text/plain Date: Fri, 24 Apr 2009 12:05:53 +0200 Message-Id: <1240567553.24225.11.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stan Behrens Cc: qemu-devel@nongnu.org On Fri, 2009-03-06 at 09:54 +0100, Stan Behrens wrote: > when you add a bluetooth-dongle, usb-flash-drive or something like that via: > usb_add host:2.23 > to you're guest-OS, qemu starts to fight against the linux-usb-configuration. > > qemu's output looks like this: > husb: open device 2.32 > husb: config #1 need -1 > husb: 1 interfaces claimed for configuration 1 > husb: grabbed usb device 2.32 > husb: config #1 need 1 > husb: 1 interfaces claimed for configuration 1 > husb: config #1 need 1 > husb: 1 interfaces claimed for configuration 1 > husb: config #1 need 1 > husb: 1 interfaces claimed for configuration 1 > husb: config #1 need 1 > husb: 1 interfaces claimed for configuration 1 > > And '# dmesg' says: > [12929.001037] usb 2-3: reset high speed USB device using ehci_hcd and address 32 > [12929.782032] usb 2-3: reset high speed USB device using ehci_hcd and address 32 > [12930.176041] usb 2-3: reset high speed USB device using ehci_hcd and address 32 > [12930.726032] usb 2-3: reset high speed USB device using ehci_hcd and address 32 This seems related to this discussion: http://lists.gnu.org/archive/html/qemu-devel/2008-10/msg01320.html (in a thread regarding a preliminary patch to implement ehci). Could you try the following patch? It was created after finally discovering the discussion mentioned above (which I hardly understand, which in turn leads to an impressive, but possibly nonsensical commit message for this patch). It seems to fix a similar issue I ran into (while trying some advanced feature of a USB memory stick I happen to have.) Paul Bolle --- [PATCH] usb-linux: use USB_RET_STALL on -EPIPE URB status If ioctl([...], USBDEVFS_REAPURBNDELAY, [...]) sets the URB status to -EPIPE use USB_RET_STALL (and not USB_RET_NAK). USB_RET_NAK can confuse guests and seems to trigger some guests to repeatedly request port resets, which slows down (or even blocks) USB operations. Signed-off-by: Paul Bolle --- usb-linux.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 70d7a1c..80ef6fc 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -277,7 +277,7 @@ static void async_complete(void *opaque) set_halt(s, p->devep); /* fall through */ default: - p->len = USB_RET_NAK; + p->len = USB_RET_STALL; break; } -- 1.6.2.2