Patchwork [7/7] xhci: fix port status

login
register
mail settings
Submitter Gerd Hoffmann
Date March 2, 2012, 1:19 p.m.
Message ID <1330694370-1078-8-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/144251/
State New
Headers show

Comments

Gerd Hoffmann - March 2, 2012, 1:19 p.m.
Don't signal port status change if the usb device isn't in attached
state.  Happens with usb-host devices with the pass-through device
being plugged out at the host.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb-xhci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c
index 8305489..e8f1b6e 100644
--- a/hw/usb-xhci.c
+++ b/hw/usb-xhci.c
@@ -2279,7 +2279,7 @@  static void xhci_update_port(XHCIState *xhci, XHCIPort *port, int is_detach)
     int nr = port->port.index + 1;
 
     port->portsc = PORTSC_PP;
-    if (port->port.dev && !is_detach) {
+    if (port->port.dev && port->port.dev->attached && !is_detach) {
         port->portsc |= PORTSC_CCS;
         switch (port->port.dev->speed) {
         case USB_SPEED_LOW: