From f76e1d814241794467366d70d3d77849a6fd5ab0 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 13 Jan 2012 14:28:56 +0100 Subject: [PATCH] usb-ehci: Clear the portstatus powner bit on device disconnect 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 file changed, 5 insertions(+) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 75ef71e69e..cdd74154a0 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; } -- 2.11.0