Skip to contentSkip to conversation

ehci: fix ehci_child_detach

PATCH In review Gerd Hoffmann 2 participants 2 messages Mar 26, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ehci: fix ehci_child_detach

Looks like a cut+paste bug from ehci_detach. When the device itself is detached from a ehci port (ehci_detach op) we have to clear the device pointer for the companion port too. When a device gets removed from a downstream port of a usb hub (ehci_child_detach op) the ehci port where the usb hub is plugged in is not affected.

---
 hw/usb/hcd-ehci.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
hw/usb/hcd-ehci.c +0 -1
index 60f9f5b..34f7538 100644
@@ -797,7 +797,6 @@ static void ehci_child_detach(USBPort *port, USBDevice *child)
     if (portsc & PORTSC_POWNER) {
         USBPort *companion = s->companion_ports[port->index];
         companion->ops->child_detach(companion, child);
-        companion->dev = NULL;
         return;
     }
 
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Oh, good one:

Regards,

Hans

Quoted 23 lines · Gerd Hoffmann

Looks like a cut+paste bug from ehci_detach. When the device itself is detached from a ehci port (ehci_detach op) we have to clear the device pointer for the companion port too. When a device gets removed from a downstream port of a usb hub (ehci_child_detach op) the ehci port where the usb hub is plugged in is not affected.

---
  hw/usb/hcd-ehci.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)
hw/usb/hcd-ehci.c +0 -1
index 60f9f5b..34f7538 100644
@@ -797,7 +797,6 @@ static void ehci_child_detach(USBPort *port, USBDevice *child)
      if (portsc&  PORTSC_POWNER) {
          USBPort *companion = s->companion_ports[port->index];
          companion->ops->child_detach(companion, child);
-        companion->dev = NULL;
          return;
      }