summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorTony Zheng <Tony.Zheng@freescale.com>2014-10-17 19:43:02 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-03 15:48:45 -0800
commit01ed67dc70834d00d62b6e754ee0f76301fbc140 (patch)
treecceaba52e4be45983d6f067c72dd7e272e0aebfb /drivers/usb/core
parentd1d9548256fbdf2e049d6413a5266c41e73658ee (diff)
downloadlinux-01ed67dc70834d00d62b6e754ee0f76301fbc140.tar.gz
linux-01ed67dc70834d00d62b6e754ee0f76301fbc140.tar.bz2
linux-01ed67dc70834d00d62b6e754ee0f76301fbc140.zip
usb: core: need to call usb_phy_notify_connect after device setup
Since we notify disconnecting based on the usb device is existed (port_dev->child, the child device at roothub is not NULL), we need to notify connect after device has been registered. This fixes a bug that do fast plug in/out test, and the notify_disconnect is not called due to roothub child is NULL and the enumeration has failed. Cc: v3.17+ <stable@vger.kernel.org> Signed-off-by: Tony Zheng <Tony.Zheng@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hub.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 11e80ac31324..65a8e5055885 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4468,9 +4468,6 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
if (retval)
goto fail;
- if (hcd->usb_phy && !hdev->parent)
- usb_phy_notify_connect(hcd->usb_phy, udev->speed);
-
/*
* Some superspeed devices have finished the link training process
* and attached to a superspeed hub port, but the device descriptor
@@ -4783,6 +4780,10 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
port_dev->child = NULL;
spin_unlock_irq(&device_state_lock);
mutex_unlock(&usb_port_peer_mutex);
+ } else {
+ if (hcd->usb_phy && !hdev->parent)
+ usb_phy_notify_connect(hcd->usb_phy,
+ udev->speed);
}
}