All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: David VomLehn <dvomlehn@cisco.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>, Ingo Molnar <mingo@elte.hu>,
	Arjan van de Ven <arjan@infradead.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux USB Mailing List <linux-usb@vger.kernel.org>,
	Linux Embedded Mailing List <linux-embedded@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Wait for console to become available, v3.2
Date: Fri, 24 Apr 2009 23:19:51 +0100	[thread overview]
Message-ID: <20090424221951.GC18260@shareable.org> (raw)
In-Reply-To: <20090424213238.GA5973@cuplxvomd02.corp.sa.net>

David VomLehn wrote:
> > This looks like a good plan and not hard to implement.  It even should 
> > be possible to fit USB disk drives into the scheme.
> 
> That would definitely rock. 

How about this, perhaps in the generic device model:

  1. Whenever a device's existence is detected by its parent bus,
     add the device id to a pool of "potential devices worth waiting for".

  2. Whenever a device is registered, remove that device id from the pool.

  3. Whenever a device is itself a bus, or has subdevices or
     attributes to be discovered, it triggers step 1 for all devices
     found by enumeration (or in the case of USB, whatever you have to
     wait for).  Then the bus can declare itself initialised.
 
  4. The top-level enumeration behaves as though there was a root bus,
     onto which the real buses like PCI etc. are attached as in step 3.

  5. Waiting for console / boot device / userspace waiting for other
     mount points all check this pool for device ids of matching type.

In this, the pool serves the same role as Alan Stern's global counter,
the difference being you can wait for particular types of device when
you need to, and this is more explicit about how a hierarchy is handled.

Device ids in this pool are simply "category" values for what the
device is relevant to - and a waitqueue.  If a PCI device is a serial
port, then goes into category "serial port", because it's relevant if
serial console is requested on the boot command line.

When waiting for a newly powered USB bus to settle, you may get
notification of all devices on it, but you might not know enough about
each device until the individual drivers start fetching descriptors.
Then you can either make every device go temporarily into the pool,
much as if it were a little bus itself, until it has detailed
information about what type of device it is.  Or you can wait until
all those devices have fetched descriptors before the USB bus declares
that its enumeration is complete and removes its own id.

-- Jamie

  reply	other threads:[~2009-04-24 22:19 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 23:40 Wait for console to become available, v3.2 David VomLehn
2009-04-21  6:43 ` Ingo Molnar
2009-04-21  6:43   ` Ingo Molnar
     [not found]   ` <20090421064346.GB8020-X9Un+BFzKDI@public.gmane.org>
2009-04-21  7:13     ` David Brownell
2009-04-21  7:13       ` David Brownell
2009-04-21  8:03       ` Ingo Molnar
2009-04-21 17:11       ` David Woodhouse
2009-04-21 17:29         ` David VomLehn
     [not found]           ` <20090421172929.GC8251-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-21 17:37             ` Linus Torvalds
2009-04-21 17:37               ` Linus Torvalds
2009-04-21 17:59               ` David VomLehn
2009-04-21 17:41             ` David Woodhouse
2009-04-21 17:41               ` David Woodhouse
2009-04-21 17:31         ` Linus Torvalds
     [not found]           ` <alpine.LFD.2.00.0904211016190.2199-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-21 19:25             ` Alan Cox
2009-04-21 19:25               ` Alan Cox
2009-04-21 23:17               ` David VomLehn
2009-04-22  8:25           ` Jamie Lokier
2009-04-22  9:11             ` Alan Cox
     [not found]               ` <20090422101109.7beee3ee-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2009-04-22 10:39                 ` Jamie Lokier
2009-04-22 10:39                   ` Jamie Lokier
2009-04-21 13:35   ` Arjan van de Ven
     [not found]     ` <20090421063549.3b71881d-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2009-04-21 13:50       ` Ingo Molnar
2009-04-21 13:50         ` Ingo Molnar
     [not found]         ` <20090421135034.GA30114-X9Un+BFzKDI@public.gmane.org>
2009-04-21 14:05           ` Jamie Lokier
2009-04-21 14:05             ` Jamie Lokier
2009-04-21 14:26             ` Ingo Molnar
     [not found]               ` <20090421142627.GA18129-X9Un+BFzKDI@public.gmane.org>
2009-04-21 14:37                 ` Alan Cox
2009-04-21 14:37                   ` Alan Cox
2009-04-22  8:22                   ` Jamie Lokier
2009-04-22  9:13                     ` Alan Cox
2009-04-21 16:42               ` David VomLehn
2009-04-21 14:36             ` Alan Stern
     [not found]               ` <Pine.LNX.4.44L0.0904211026080.2981-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-21 16:52                 ` David VomLehn
2009-04-21 16:52                   ` David VomLehn
2009-04-21 19:09                   ` Alan Stern
     [not found]                     ` <Pine.LNX.4.44L0.0904211457150.3986-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-21 23:08                       ` David VomLehn
2009-04-21 23:08                         ` David VomLehn
2009-04-22 15:40                         ` Alan Stern
     [not found]                           ` <Pine.LNX.4.44L0.0904221111320.3405-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-22 20:54                             ` David VomLehn
2009-04-22 20:54                               ` David VomLehn
2009-04-22 21:08                               ` Alan Cox
2009-04-22 21:24                                 ` Alan Stern
2009-04-24  0:35                                   ` David VomLehn
2009-04-24  0:35                                     ` David VomLehn
     [not found]                                     ` <20090424003555.GA31173-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-24 19:20                                       ` Alan Stern
2009-04-24 19:20                                         ` Alan Stern
     [not found]                                         ` <Pine.LNX.4.44L0.0904241502440.4531-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-04-24 21:32                                           ` David VomLehn
2009-04-24 21:32                                             ` David VomLehn
2009-04-24 22:19                                             ` Jamie Lokier [this message]
     [not found]                                               ` <20090424221951.GC18260-yetKDKU6eevNLxjTenLetw@public.gmane.org>
2009-04-24 23:10                                                 ` David VomLehn
2009-04-24 23:10                                                   ` David VomLehn
     [not found]                                                   ` <20090424231013.GA18340-CFZJ1or75eBPWxJt6d6B6bQa8qPdvLwY@public.gmane.org>
2009-04-25  1:41                                                     ` Jamie Lokier
2009-04-25  1:41                                                       ` Jamie Lokier
2009-04-25  3:11                                                       ` Alan Stern
2009-04-26 19:52                                                         ` Jamie Lokier
2009-04-26 21:20                                                           ` Alan Stern
2009-04-26 21:37                                                             ` Jamie Lokier
2009-04-26 22:36                                                               ` Kay Sievers
2009-04-26 23:12                                                                 ` Jamie Lokier
2009-04-26 23:23                                                                   ` Kay Sievers
2009-04-26 23:23                                                                     ` Kay Sievers
2009-04-26 23:46                                                                     ` Jamie Lokier
     [not found]                                                       ` <20090425014152.GD23106-yetKDKU6eevNLxjTenLetw@public.gmane.org>
2009-04-26 17:55                                                         ` David VomLehn
2009-04-26 17:55                                                           ` David VomLehn
2009-04-22  5:35                       ` David VomLehn
2009-04-22  5:35                         ` David VomLehn

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=20090424221951.GC18260@shareable.org \
    --to=jamie@shareable.org \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=dvomlehn@cisco.com \
    --cc=hpa@zytor.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stern@rowland.harvard.edu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.