Re: Module Ideas: Persistence, PnP, and more...

David Howells (David.Howells@nexor.co.uk)
Wed, 09 Sep 1998 09:35:29 BST


> Why would you want any driver which needs to be runtime-configurable not to
> be a module?
>
> Since the driver needs config information, said information needs to come
> from _somewhere_, i.e. a file system, therefore you can just load the
> driver from the file system.
>
> I'm currently doing that with every driver under the sun, except for the
> ELF loader and romfs. And I doubt I'm the only one.

I have to admit, I wouldn't have though of using romfs in this way... I've
only thought of it in terms of initial installation before. One thing I'm
uncertain of with it is how the kernel finds the romfs 'drive' on booting... I
know it must be possible - after all, I've seen it when installing Linux from
floppy or bootable CD-ROM.

> The call to reconfigure drivers needs to be atomic, i.e. "here's a list of
> drivers and the new configuration information for all of them". If even one
> of them says "no, I cannot use this", presumably you have kept the old
> data in the kernel and can restore everything.

The device/driver (re-)configuration is atomic, though done one device at a
time at the moment. It would be possible to hand a stack of devices to the
rebinding algorithm to do all in one go, as that it is how it works internally
anyway.

It is also done in two stages...

(1) The new configurations are calculated (only one k-thread at a time is
allowed to do this), but it can be interrupted and an interrupt routine
request a change that is allowed under the circumstances, the calculation
is aborted and begun again.
Should negotiations fail, then the calculations are all discarded, no
changes actually being attempted.

(2) Then any devices whose configurations are changed are updated under more
restrictive conditions, and their respective drivers updated too.

> This is not just idle theory, because you might need to reconfigure your
> low-level SCSI driver (for example, when somebody hotswaps a PCI card).
> This needs to be atomic or you're in BIG trouble.

Hot swapping was one of the things I have in mind, but it's hard to test for
me, as I have no hot-swapping hardware, and can't afford just to buy some to
play with.

Thinking of SCSI, I also considered the possibility of making another
configuration token describing bus/LUN etc., and binding high-level SCSI
device drivers to low-level SCSI interface drivers by the same device/driver
handling method. However, I'm uncertain as to the practicality of this idea,
having not studied the SCSI drivers much.

David Howells

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html