1b1995d
From 959f57d34f11daf0da6f73541243934f39dfb2b2 Mon Sep 17 00:00:00 2001
1b1995d
From: Hans de Goede <hdegoede@redhat.com>
1b1995d
Date: Fri, 13 Jan 2012 14:26:26 +0100
1b1995d
Subject: [PATCH 119/140] usb-ehci: Clear the portstatus powner bit on device
1b1995d
 disconnect
1b1995d
1b1995d
According to the EHCI spec port ownerhsip should revert to the EHCI controller
1b1995d
on device disconnect. This fixes the problem of a port getting stuck on USB 1
1b1995d
when using redirection and plugging in a USB 2 device after a USB 1 device
1b1995d
has been redirected.
1b1995d
1b1995d
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1b1995d
---
1b1995d
 hw/usb-ehci.c |    5 +++++
1b1995d
 1 file changed, 5 insertions(+)
1b1995d
1b1995d
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
1b1995d
index a946e1d..69bcc4b 100644
1b1995d
--- a/hw/usb-ehci.c
1b1995d
+++ b/hw/usb-ehci.c
1b1995d
@@ -764,6 +764,11 @@ static void ehci_detach(USBPort *port)
1b1995d
         USBPort *companion = s->companion_ports[port->index];
1b1995d
         companion->ops->detach(companion);
1b1995d
         companion->dev = NULL;
1b1995d
+        /*
1b1995d
+         * EHCI spec 4.2.2: "When a disconnect occurs... On the event,
1b1995d
+         * the port ownership is returned immediately to the EHCI controller."
1b1995d
+         */
1b1995d
+        *portsc &= ~PORTSC_POWNER;
1b1995d
         return;
1b1995d
     }
1b1995d
 
1b1995d
-- 
1b1995d
1.7.9.3
1b1995d