From 25162979e6441cd0a464c7b47e21316830e294e7 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Thu, 21 Mar 2013 14:56:17 +0800 Subject: [PATCH] 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 (cherry picked from commit 54d314b320e8adee0593d1bed045197f134cd9cc) --- drivers/usb/core/hub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 879b66e13370..fb3da75760b6 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -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); } -- 2.39.5