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: Re: [PATCH RFC] USB: Add HCD fastboot
Date: Wed, 06 Aug 2008 21:07:03 +0100 [thread overview]
Message-ID: <489A0467.1060607@simon.arlott.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0808061543340.2138-100000@iolanthe.rowland.org>
On 06/08/08 20:49, Alan Stern wrote:
> On Wed, 6 Aug 2008, Simon Arlott wrote:
>
>> > Wouldn't it be much simpler, and less objectionable, to do what I
>> > suggested earlier? That is, add a 5-second delay at the start of
>> > hub_thread() in drivers/usb/core/hub.c. No messing with Makefiles, no
>> > changes to the initcall scheduling.
>>
>> Aside from 5 seconds being too long, and anything less being a race between
>> hub_thread() and driver initcalls, it doesn't improve anything because it'll
>> still have to wait for the devices to finish initialising in userspace instead.
>
> Why is 5 seconds too long? Too long for what?
>
> What you're doing is already a race between hub_thread() and driver
> initcalls. My suggestion is no worse.
No, by adding a 5 second delay you're intending for the device driver initcalls
to complete within that 5 seconds. If they take too long then the last one
blocks everything (I realise that's ridiculous, these initcalls take <1ms when
there are no devices yet). The best way to do is to make the driver initcalls
before the host ones, like you suggested.
> "it'll still have to wait..." If by "it" you mean the initcall
> thread, you're wrong. If by "it" you mean the user, you still aren't
> necessarily correct; the user can do plenty of other things while
> waiting for USB devices to initialize.
Assuming userspace doesn't wait for all devices to settle and appear in /dev etc.
before continuing.
> I suppose you could make the hub_thread delay time a module parameter
> for usbcore, defaulting to 0. Then it could be set by just the people
> who want to use it -- many (most?) people keep their drivers in
> modules, and it wouldn't do them any good.
It really needs to have hcd initcalls done very early so that device init
has the rest of the (kernel and userspace) boot process to complete in the
background. This is negated by having device drivers initialised immediately
afterwards. Re-ordering initcalls and doing more of the init process
asynchronously is likely to expose bugs and cause inconsistent device order
on some systems, so if the makefile mess could be reduced then it can be a
Kconfig option.
How many people have *all* their USB components (hcd, drivers) as modules?
What do they do with their USB keyboards in the period between init and module
load? If even one device driver and the hcd is compiled in, they'd need to
wait for every USB device to finish init before the usbhid probe could complete.
--
Simon Arlott
next prev parent reply other threads:[~2008-08-06 20:07 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 ` [PATCH RFC] USB: Add HCD fastboot Simon Arlott
2008-08-06 19:11 ` 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 [this message]
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=489A0467.1060607@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