From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlhAb-0004lF-D9 for qemu-devel@nongnu.org; Fri, 13 Jan 2012 08:27:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlhAa-0001Ka-5U for qemu-devel@nongnu.org; Fri, 13 Jan 2012 08:27:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlhAZ-0001KV-Ky for qemu-devel@nongnu.org; Fri, 13 Jan 2012 08:27:48 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0DDRkx4032672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 Jan 2012 08:27:46 -0500 From: Hans de Goede Date: Fri, 13 Jan 2012 14:28:56 +0100 Message-Id: <1326461336-5699-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH] usb-ehci: Clear the portstatus powner bit on device disconnect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org According to the EHCI spec port ownerhsip should revert to the EHCI controller on device disconnect. This fixes the problem of a port getting stuck on USB 1 when using redirection and plugging in a USB 2 device after a USB 1 device has been redirected. Signed-off-by: Hans de Goede --- hw/usb-ehci.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index a946e1d..69bcc4b 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -764,6 +764,11 @@ static void ehci_detach(USBPort *port) USBPort *companion = s->companion_ports[port->index]; companion->ops->detach(companion); companion->dev = NULL; + /* + * EHCI spec 4.2.2: "When a disconnect occurs... On the event, + * the port ownership is returned immediately to the EHCI controller." + */ + *portsc &= ~PORTSC_POWNER; return; } -- 1.7.7.4