]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00255359 usb: core: notify disconnection when core detects disconnect
authorPeter Chen <peter.chen@freescale.com>
Thu, 21 Mar 2013 06:56:17 +0000 (14:56 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 16:07:23 +0000 (18:07 +0200)
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)

drivers/usb/core/hub.c

index 879b66e13370b5fc80fda8709d12dbbb2bd7d788..fb3da75760b64c525a62e35ff68bf0fd4890e583 100644 (file)
@@ -4527,8 +4527,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
 
        /* Disconnect any existing devices under this port */
        if (udev) {
-               if (hcd->phy && !hdev->parent &&
-                               !(portstatus & USB_PORT_STAT_CONNECTION))
+               if (hcd->phy && !hdev->parent)
                        usb_phy_notify_disconnect(hcd->phy, udev->speed);
                usb_disconnect(&port_dev->child);
        }