Skip to contentSkip to conversation

usb-ehci: Clear the portstatus powner bit on device disconnect

PATCH In review Hans de Goede 3 participants 4 messages Jan 13, 2012 – Jan 23, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb-ehci: Clear the portstatus powner bit on device disconnect

According to the EHCI spec port ownerhsip 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.

---
 hw/usb-ehci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
hw/usb-ehci.c +5 -0
index a946e1d..69bcc4b 100644
@@ -764,6 +764,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;
     }
 
Signature · 1 line
1.7.7.4
#1 lore raw
Quoted 4 lines · Hans de Goede

According to the EHCI spec port ownerhsip 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.

Patch added to usb patch queue.

thanks,
Gerd

#2 lore raw

Am 23.01.2012 15:51, schrieb Gerd Hoffmann:

Quoted 2 lines · Hans de Goede
Quoted 1 line

According to the EHCI spec port ownerhsip should revert to the EHCI controller

ownership

Quoted 5 lines
Quoted 3 lines

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.

Patch added to usb patch queue.

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#3 lore raw
Quoted 5 lines · Andreas Färber

Am 23.01.2012 15:51, schrieb Gerd Hoffmann:

Quoted 2 lines · Hans de Goede
Quoted 1 line

According to the EHCI spec port ownerhsip should revert to the EHCI controller

ownership

Fixed.

thanks,
Gerd