Re: udev sysfs docs Re: State of devfs in 2.6?

Rob Landley
2003-12-10T08:25:35Z

On Tuesday 09 December 2003 01:56, Greg KH wrote:
> On Tue, Dec 09, 2003 at 06:17:28AM +0100, Witukind wrote:
> > From the udev FAQ:
> >
> > Q: But udev will not automatically load a driver if a /dev node is opened
> > when it is not present like devfs will do.
> > A: If you really require this functionality, then use devfs. It is still
> > present in the kernel.
> >
> > Will it have this 'equivalent functionality' some day?
>
> Heh, no. I really don't believe all of the people who keep asking me
> this. I think I need to reword this answer to something like:
> A: That is correct. If you really require this functionality, then
> use devfs. There is no way that udev can support this, and it
> never will.
>
> That better? :)
>
> thanks,
>
> greg k-h

I think another way of saying it is that we now have a hotplug infrastructure
to load the driver on an insert event, so if you want to load the driver for
something that A) isn't detected on startup, B) isn't detected on a hotplug
event when it's inserted after startup, the way to do it is to call modprobe,
not to mknod a random device node and then try to open it and hope some magic
side effect of open loads the correct module with the right parameters to
make things work.

The driver is now loaded while the device is attached to the system, not just
while the device is in use. (Less races that way, you get to save state
between invocations, etc.) The lifetime rules changed.

The old way of doing it assumes you have a device node for a device that has
no driver loaded, which was the default under the old static /dev but not the
case in a fully hotplug system. You have /dev nodes for devices that are in
the system (with drivers loaded), and you don't for ones that aren't.

Rob

(I could be completely wrong about all this, of course...)