From ab47b92aa3badeb3d55c3f7fd8296c2ec923c3ed Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Fri, 9 Nov 2012 09:44:43 +0800 Subject: [PATCH] --- yaml --- r: 338675 b: refs/heads/master c: b76baa8154335a906be85f2b32d6bd1876900133 h: refs/heads/master i: 338673: b73c3990ce801674d6895126b3d0d4715e859ee0 338671: 870510e9d8ea1dce0900cc4a98b6fcdb1b3fc88a v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/hub.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 41a7632ace2d..0f0f322dd98a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0e1a024d1a16ae1b3d01495d3bcd34f285724e7e +refs/heads/master: b76baa8154335a906be85f2b32d6bd1876900133 diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 90accdefdc7d..8391538d688b 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -4038,6 +4038,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, if (retval) goto fail; + if (hcd->phy && !hdev->parent) + usb_phy_notify_connect(hcd->phy, port1); + /* * Some superspeed devices have finished the link training process * and attached to a superspeed hub port, but the device descriptor @@ -4232,8 +4235,12 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, } /* Disconnect any existing devices under this port */ - if (udev) + if (udev) { + if (hcd->phy && !hdev->parent && + !(portstatus & USB_PORT_STAT_CONNECTION)) + usb_phy_notify_disconnect(hcd->phy, port1); usb_disconnect(&hub->ports[port1 - 1]->child); + } clear_bit(port1, hub->change_bits); /* We can forget about a "removed" device when there's a physical @@ -4256,13 +4263,6 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, } } - if (hcd->phy && !hdev->parent) { - if (portstatus & USB_PORT_STAT_CONNECTION) - usb_phy_notify_connect(hcd->phy, port1); - else - usb_phy_notify_disconnect(hcd->phy, port1); - } - /* Return now if debouncing failed or nothing is connected or * the device was "removed". */