Re: Wait for console to become available, v3.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux