diff options
author | Peter Chen <peter.chen@freescale.com> | 2013-03-21 02:56:17 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:47:14 -0400 |
commit | 211a84e598d7ac52d0d0a00e6d0f6bfbebf04af0 (patch) | |
tree | abafce0528bf6db383e3a2e558e21fbc4f2ae903 /drivers/usb/core | |
parent | 0002582e62c65feee81632329e9202505d3d4d77 (diff) |
ENGR00255359 usb: core: notify disconnection when core detects disconnect
It is safe to call notify disconnect when the usb core
thinks the device is disconnected.
This commit also fixes one bug found at below situation:
we have not enabled usb wakeup, we do suspend when there
is an usb device at the port, after suspend, we plug out
the usb device, then plug in device again. At that time,
the nofity disconnect was not called at former code, as
the controller doesn't know the usb device was disconnected
during the suspend, but USB core knows, so to fix this problem,
let the usb core call notify disconnect.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 54d314b320e8adee0593d1bed045197f134cd9cc)
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hub.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e604645a1290..a2c100fecd97 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -4372,8 +4372,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, | |||
4372 | 4372 | ||
4373 | /* Disconnect any existing devices under this port */ | 4373 | /* Disconnect any existing devices under this port */ |
4374 | if (udev) { | 4374 | if (udev) { |
4375 | if (hcd->phy && !hdev->parent && | 4375 | if (hcd->phy && !hdev->parent) |
4376 | !(portstatus & USB_PORT_STAT_CONNECTION)) | ||
4377 | usb_phy_notify_disconnect(hcd->phy, udev->speed); | 4376 | usb_phy_notify_disconnect(hcd->phy, udev->speed); |
4378 | usb_disconnect(&hub->ports[port1 - 1]->child); | 4377 | usb_disconnect(&hub->ports[port1 - 1]->child); |
4379 | } | 4378 | } |