From 548625a35077a9b7b5d6c468e26e2cdeb644e80d Mon Sep 17 00:00:00 2001 From: Primoz Fiser Date: Tue, 1 Oct 2019 10:17:59 +0200 Subject: usb: usb_hub_port_connect_change(): Remove unnecessary delays Remove two mdelay(200) calls from usb_hub_port_connect_change() before and after calling hub_port_reset(). These delays don't seem to be necessary since hub_port_reset() already incorporates delays on its own. Without patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 16355ms With patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 10344ms Delta: ~6 seconds Signed-off-by: Primoz Fiser Signed-off-by: Sascha Hauer --- drivers/usb/core/hub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 91604e1ef5..7de6aedc45 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -211,8 +211,6 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port) if (dev->children[port] && !(portstatus & USB_PORT_STAT_ENABLE)) usb_remove_device(dev->children[port]); - mdelay(200); - /* Allocate a new device struct for the port */ usb = usb_alloc_new_device(); usb->dev.parent = &dev->dev; @@ -225,8 +223,6 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port) return; } - mdelay(200); - dev->children[port] = usb; usb->parent = dev; usb->portnr = port + 1; -- cgit v1.2.3