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

From: Rob Landley
Date: Wed Dec 10 2003 - 03:26:32 EST


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