aboutsummaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-01-13 14:28:56 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-10 11:12:04 +0100
commitf76e1d814241794467366d70d3d77849a6fd5ab0 (patch)
treedf9ae09697350126d7c603f0515d050f906eae24 /hw
parent3200d1085df5f368885428e33d9439f55c7f1a47 (diff)
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 <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb-ehci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index 75ef71e69..cdd74154a 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;
}