aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-11-24 20:01:43 -0500
committerDavid S. Miller <davem@davemloft.net>2018-11-24 20:01:43 -0500
commitb1bf78bfb2e4c9ffa03ccdbc60d89a2f7c5fd82c (patch)
treefcd93c3f54a72ca6a6ee97f015efebe6d80a3271 /drivers/usb/core/hub.c
parentaea0a897af9e44c258e8ab9296fad417f1bc063a (diff)
parentd146194f31c96f9b260c5a1cf1592d2e7f82a2e2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index c6077d582d29..0f9381b69a3b 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2794,6 +2794,7 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
2794 int i, status; 2794 int i, status;
2795 u16 portchange, portstatus; 2795 u16 portchange, portstatus;
2796 struct usb_port *port_dev = hub->ports[port1 - 1]; 2796 struct usb_port *port_dev = hub->ports[port1 - 1];
2797 int reset_recovery_time;
2797 2798
2798 if (!hub_is_superspeed(hub->hdev)) { 2799 if (!hub_is_superspeed(hub->hdev)) {
2799 if (warm) { 2800 if (warm) {
@@ -2849,7 +2850,9 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
2849 USB_PORT_FEAT_C_BH_PORT_RESET); 2850 USB_PORT_FEAT_C_BH_PORT_RESET);
2850 usb_clear_port_feature(hub->hdev, port1, 2851 usb_clear_port_feature(hub->hdev, port1,
2851 USB_PORT_FEAT_C_PORT_LINK_STATE); 2852 USB_PORT_FEAT_C_PORT_LINK_STATE);
2852 usb_clear_port_feature(hub->hdev, port1, 2853
2854 if (udev)
2855 usb_clear_port_feature(hub->hdev, port1,
2853 USB_PORT_FEAT_C_CONNECTION); 2856 USB_PORT_FEAT_C_CONNECTION);
2854 2857
2855 /* 2858 /*
@@ -2885,11 +2888,18 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
2885 2888
2886done: 2889done:
2887 if (status == 0) { 2890 if (status == 0) {
2888 /* TRSTRCY = 10 ms; plus some extra */
2889 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) 2891 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM)
2890 usleep_range(10000, 12000); 2892 usleep_range(10000, 12000);
2891 else 2893 else {
2892 msleep(10 + 40); 2894 /* TRSTRCY = 10 ms; plus some extra */
2895 reset_recovery_time = 10 + 40;
2896
2897 /* Hub needs extra delay after resetting its port. */
2898 if (hub->hdev->quirks & USB_QUIRK_HUB_SLOW_RESET)
2899 reset_recovery_time += 100;
2900
2901 msleep(reset_recovery_time);
2902 }
2893 2903
2894 if (udev) { 2904 if (udev) {
2895 struct usb_hcd *hcd = bus_to_hcd(udev->bus); 2905 struct usb_hcd *hcd = bus_to_hcd(udev->bus);