From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvot6-0005te-LS for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvosz-0000GX-UR for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvosz-0000G7-Ij for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:29 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1ABhSoZ000648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Feb 2012 06:43:28 -0500 From: Gerd Hoffmann Date: Fri, 10 Feb 2012 12:42:58 +0100 Message-Id: <1328874204-20920-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1328874204-20920-1-git-send-email-kraxel@redhat.com> References: <1328874204-20920-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 02/28] usb-ehci: Clear the portstatus powner bit on device disconnect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede According to the EHCI spec port ownership 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 Signed-off-by: Gerd Hoffmann --- 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 75ef71e..cdd7415 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -765,6 +765,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.1