mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Arlott <simon@fire.lp0.eu>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Rene Herman <rene.herman@keyaccess.nl>,
	Arjan van de Ven <arjan@infradead.org>,
	linux-kernel@vger.kernel.org, mingo@elte.hu,
	Daniel Walker <dwalker@mvista.com>,
	USB list <linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH RFC] USB: Add HCD fastboot
Date: Wed, 06 Aug 2008 19:40:53 +0100	[thread overview]
Message-ID: <4899F035.9040003@simon.arlott.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0807311510220.5019-100000@iolanthe.rowland.org>

On 31/07/08 20:16, Alan Stern wrote:
>> > It's not entirely clear why usblp is blocking at all.  Probably because
>> > it is waiting on the device semaphores for devices that are currently
>> > being probed -- the driver core won't allow two threads to probe the
>> > same device concurrently.
>> 
>> Ok - so there could be some big improvements to be had by making the hcd 
>> init happen as early as possible and the device initcalls later?
> 
> Maybe.  Perhaps a better approach would be to make the device driver 
> initcalls before there are any devices for their probe routines to 
> block on.

What about this?

The Makefiles become a bit messy, but by moving things around I get the 
desired effect without splitting their initcalls.

[    7.941890] Write protecting the kernel read-only data: 5656k
[    5.437709] Write protecting the kernel read-only data: 5656k

2.5s faster, which is almost half the boot time.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>

---
 drivers/Makefile         |   13 ++++++++++---
 drivers/usb/Makefile     |   30 ++++++++++++++++++++----------
 drivers/usb/core/Kconfig |   17 +++++++++++++++++
 3 files changed, 47 insertions(+), 13 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index a280ab3..d68151f 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -33,7 +33,12 @@ obj-$(CONFIG_FB_INTEL)          += video/intelfb/
 
 obj-y				+= serial/
 obj-$(CONFIG_PARPORT)		+= parport/
-obj-y				+= base/ block/ misc/ mfd/ net/ media/
+obj-y				+= base/ block/
+ifdef CONFIG_USB_FASTBOOT
+  obj-$(CONFIG_USB)		+= usb/
+  obj-$(CONFIG_PCI)		+= usb/
+endif
+obj-y				+= net/ media/
 obj-$(CONFIG_NUBUS)		+= nubus/
 obj-$(CONFIG_ATM)		+= atm/
 obj-y				+= macintosh/
@@ -56,8 +61,10 @@ obj-$(CONFIG_MAC)		+= macintosh/
 obj-$(CONFIG_ATA_OVER_ETH)	+= block/aoe/
 obj-$(CONFIG_PARIDE) 		+= block/paride/
 obj-$(CONFIG_TC)		+= tc/
-obj-$(CONFIG_USB)		+= usb/
-obj-$(CONFIG_PCI)		+= usb/
+ifndef CONFIG_USB_FASTBOOT
+  obj-$(CONFIG_USB)		+= usb/
+  obj-$(CONFIG_PCI)		+= usb/
+endif
 obj-$(CONFIG_USB_GADGET)	+= usb/gadget/
 obj-$(CONFIG_SERIO)		+= input/serio/
 obj-$(CONFIG_GAMEPORT)		+= input/gameport/
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index a419c42..35766a1 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -8,16 +8,22 @@ obj-$(CONFIG_USB)		+= core/
 
 obj-$(CONFIG_USB_MON)		+= mon/
 
-obj-$(CONFIG_PCI)		+= host/
-obj-$(CONFIG_USB_EHCI_HCD)	+= host/
-obj-$(CONFIG_USB_ISP116X_HCD)	+= host/
-obj-$(CONFIG_USB_OHCI_HCD)	+= host/
-obj-$(CONFIG_USB_UHCI_HCD)	+= host/
-obj-$(CONFIG_USB_SL811_HCD)	+= host/
-obj-$(CONFIG_USB_U132_HCD)	+= host/
-obj-$(CONFIG_USB_R8A66597_HCD)	+= host/
-
-obj-$(CONFIG_USB_C67X00_HCD)	+= c67x00/
+tmp-y				:=
+tmp-m				:=
+tmp-$(CONFIG_PCI)		+= host/
+tmp-$(CONFIG_USB_EHCI_HCD)	+= host/
+tmp-$(CONFIG_USB_ISP116X_HCD)	+= host/
+tmp-$(CONFIG_USB_OHCI_HCD)	+= host/
+tmp-$(CONFIG_USB_UHCI_HCD)	+= host/
+tmp-$(CONFIG_USB_SL811_HCD)	+= host/
+tmp-$(CONFIG_USB_U132_HCD)	+= host/
+tmp-$(CONFIG_USB_R8A66597_HCD)	+= host/
+tmp-$(CONFIG_USB_C67X00_HCD)	+= c67x00/
+obj-m				+= $(tmp-m)
+
+ifndef CONFIG_USB_FASTBOOT
+  obj-y				+= $(tmp-y)
+endif
 
 obj-$(CONFIG_USB_ACM)		+= class/
 obj-$(CONFIG_USB_PRINTER)	+= class/
@@ -34,3 +40,7 @@ obj-$(CONFIG_USB)		+= misc/
 
 obj-$(CONFIG_USB_ATM)		+= atm/
 obj-$(CONFIG_USB_SPEEDTOUCH)	+= atm/
+
+ifdef CONFIG_USB_FASTBOOT
+  obj-y				+= $(tmp-y)
+endif
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index cc9f397..ea04a02 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -136,3 +136,20 @@ config USB_OTG_BLACKLIST_HUB
 	  and software costs by not supporting external hubs.  So
 	  are "Emedded Hosts" that don't offer OTG support.
 
+
+config USB_FASTBOOT
+	bool "USB Fastboot (EXPERIMENTAL)"
+	depends on USB && EXPERIMENTAL
+	default n
+	help
+	  If you say Y here, USB device driver initialisation will be
+	  performed much earlier on boot followed by HCD initialisation.
+	  Devices will then be initialised in the background USB hub
+	  thread during the rest of the boot process.
+
+	  Side effects of enabling this include IRQ assignments being
+	  different from a normal bootup and the potential for USB and
+	  non-USB devices to be ordered differently on each startup.
+	  (i.e. usb sda, sata sdb vs. sata sda, usb sdb)
+
+	  If you are unsure about this, say N here.
-- 
1.5.6.3

-- 
Simon Arlott

  reply	other threads:[~2008-08-06 18:48 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-20 15:59 [patch 4/3] fastboot: hold the BKL over the async init call sequence Arjan van de Ven
2008-07-20 16:00 ` [patch 5/3] fastboot: sync the async execution before late_initcall and move level 6s (sync) first Arjan van de Ven
2008-07-20 16:40   ` Ingo Molnar
2008-07-20 21:14   ` Daniel Walker
2008-07-20 21:23     ` Simon Arlott
2008-07-20 21:50     ` Arjan van de Ven
2008-07-29 21:00   ` Rene Herman
2008-07-29 21:04     ` Arjan van de Ven
2008-07-29 21:12       ` Rene Herman
2008-07-29 21:21         ` Arjan van de Ven
2008-07-29 22:30           ` Rene Herman
2008-07-29 22:34             ` Simon Arlott
2008-07-30 14:08               ` Alan Stern
2008-07-30 18:25                 ` Simon Arlott
2008-07-30 19:41                   ` Alan Stern
2008-07-31 11:49                     ` Simon Arlott
2008-07-31 15:34                       ` Alan Stern
2008-07-31 18:29                         ` Simon Arlott
2008-07-31 18:56                           ` Rene Herman
2008-07-31 19:27                             ` Simon Arlott
2008-07-31 19:16                           ` Alan Stern
2008-08-06 18:40                             ` Simon Arlott [this message]
2008-08-06 19:11                               ` [PATCH RFC] USB: Add HCD fastboot Alan Stern
2008-08-06 19:20                                 ` Simon Arlott
2008-08-06 19:29                                   ` Greg KH
2008-08-06 19:49                                   ` Alan Stern
2008-08-06 19:56                                     ` Arjan van de Ven
2008-08-06 20:09                                       ` Alan Stern
2008-08-06 20:17                                         ` Arjan van de Ven
2008-08-06 20:27                                           ` Alan Stern
2008-08-06 20:07                                     ` Simon Arlott
2008-08-06 20:26                                       ` Alan Stern
2008-08-06 21:49                                         ` Simon Arlott
2008-08-06 22:34                                           ` Alan Stern
2008-08-06 22:53                                             ` Simon Arlott
2008-08-07 14:14                                               ` Alan Stern
2008-08-07  3:29                                             ` David Brownell
2008-08-07  9:28                                           ` Emanoil Kotsev
2008-08-07 16:47                                             ` Alan Stern
2008-08-07  3:34                               ` David Brownell
2008-08-08  9:24                               ` Rene Herman
2008-08-08 11:29                                 ` Simon Arlott
2008-08-08 14:30                                   ` Rene Herman
2008-07-31 21:56                           ` [patch 5/3] fastboot: sync the async execution before late_initcall and move level 6s (sync) first Greg KH
2008-07-31 22:12                             ` Simon Arlott
2008-07-31 22:37                               ` Simon Arlott
2008-09-16 22:19                             ` Tim Bird

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=4899F035.9040003@simon.arlott.org.uk \
    --to=simon@fire.lp0.eu \
    --cc=arjan@infradead.org \
    --cc=dwalker@mvista.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rene.herman@keyaccess.nl \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®