]> git.proxmox.com Git - qemu.git/commitdiff
usb-ehci: Clear the portstatus powner bit on device disconnect
authorHans de Goede <hdegoede@redhat.com>
Fri, 13 Jan 2012 13:28:56 +0000 (14:28 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 10 Feb 2012 10:12:04 +0000 (11:12 +0100)
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>
hw/usb-ehci.c

index 75ef71e69ee98844b319f69924c47e7ccc9dc10b..cdd74154a066b676b64185677a516087e723a133 100644 (file)
@@ -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;
     }