Re: Input sysbsystema and hotplug

From: David Brownell
Date: Sun Jun 19 2005 - 09:48:25 EST


On Tuesday 14 June 2005 12:47 am, Hannes Reinecke wrote:
>
> Because there are _two_ events with the name 'input'.
> Both run under the same name but carry different information.
> One is required to load the module and the other is required to create
> the device node.
>
> That's what I call an abomination.

Or at least messy, though it's been true forever that all the
event classes have included multiple events. USB hotplug has
aided both "interface" and "device" driver match policies since
before 2.4.0, for example. I guess "input" has seemed simpler,
partially because it started later and slimmer.


Maybe starting with the next kernel or so, distros should be
starting to avoid these issues by converting to slim versions
of the /sbin/hotplug script, handling the two steps separately.

First the driver loading ... for USB, PCI/Cardbus, and PCMCIA
this usually suffices:

if [ "$ACTION" = "add" -a -n "$MODALIAS" -a ! -L $DEVPATH/driver ]
then
modprobe -q $MODALIAS
fi

Then (otherwise?) the device node creation

if [ -n "$DEVPATH" ]
then
/sbin/udevsend $1
fi

And don't have any /etc/hotplug or /etc/hotplug.d scripts.
(There'd still need to be an /etc/init.d/coldplug to make
up for hotplug events that preceded viable userspace.)

One problem with that is that not all subsystems yet support
the new $MODALIAS (and /sys/devices/.../modalias) stuff, and
of course "input" is one subsystem that doesn't.

That support shifts the "what module to load" logic from
hotplug scripts (slow and no-longer-appropriate) over to
module-init-tools (3.2 and newer for the PCMCIA support).

- Dave

-
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/