mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Primoz Fiser <primoz.fiser@norik.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] usb: usb_hub_port_connect_change(): Remove unnecessary delays
Date: Tue,  1 Oct 2019 10:17:59 +0200	[thread overview]
Message-ID: <20191001081800.19128-3-primoz.fiser@norik.com> (raw)
In-Reply-To: <20191001081800.19128-1-primoz.fiser@norik.com>

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 <primoz.fiser@norik.com>
---
 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 91604e1ef..7de6aedc4 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;
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2019-10-01  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  8:17 [PATCH 0/3] usb: Reduce USB scanning time Primoz Fiser
2019-10-01  8:17 ` [PATCH 1/3] usb: hub_port_reset(): Speedup hub reset handling Primoz Fiser
2019-10-01  8:17 ` Primoz Fiser [this message]
2019-10-01  8:18 ` [PATCH 3/3] usb: Change power-on / scanning timeout handling Primoz Fiser
2019-10-02  7:11 ` [PATCH 0/3] usb: Reduce USB scanning time Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191001081800.19128-3-primoz.fiser@norik.com \
    --to=primoz.fiser@norik.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox