Re: MODULE_DEVICE_TABLE(isapnp, ...) does nothing

From: Kay Sievers
Date: Wed Nov 25 2009 - 06:40:04 EST


On Wed, Nov 25, 2009 at 00:51, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
> On Tue, 24 Nov 2009 07:23:51 pm Kay Sievers wrote:
>> On Mon, Nov 23, 2009 at 22:51, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
>> > On Mon, 23 Nov 2009 07:10:22 pm Takashi Iwai wrote:
>> >> At Mon, 23 Nov 2009 13:59:53 +1030, Rusty Russell wrote:
>> >> > Two things are required:
>> >> > 1) Modify file2alias to add aliases for isapnp. ÂThis is pretty easy.
>> >> > 2) Expose the isapnp devices in sysfs where udev will match them up
>> >> > Â Â(/sys/bus/isa/devices/<dev>/modalias I guess?)
>> >>
>> >> There is non-pnp ISA bus, so I'm afraid "isa" may conflict.
>> >> I suppose "isapnp" would be a safer choice.
>> >
>> > Without pnp, I don't think you can enumerate the ISA bus. Hence I chose
>> > "isa:" in the hope that udev would "just work" if isapnp created the
>> > modalias under /sys/bus/isa...
>> >
>> > But Kay says there's a pnp bus (who knew?). ÂI don't know what he means
>> > by unfixable aliases tho, since it's all in the kernel source so we can
>> > change it at any time?
>>
>> Here's a bit of the background:
>>
>> The aliases in the modules can only match a single value, but PNP
>> devices often have vendor specific IDs and usual IDs describing the
>> function.
>
> I'm confused. ÂYou can have multiple aliases in a module. ÂMany do.

Sure, but we have only a single modalias string to match against. The
aliases need to be in a form where they can match the modalias string
containing more than a single entry. The current ones can't do that,
but they were known to be used by some systems with hacky shell
scripts or custom modprobe configs to load pnp device modules.

>> Like here, where the interesting ID is only the second one of the two
>> for a single device:
>> Â $ grep . /sys/bus/pnp/devices/*/id
>> Â /sys/bus/pnp/devices/00:09/id:LEN0006
>> Â /sys/bus/pnp/devices/00:09/id:PNP0f13
>>
>> So the kernel device would need to compose a "modalias" string with
>> all IDs in a single line. But the in-module aliases can unfortunately
>> match only on a single value, like:
>> Â alias pnp:dPNP0700* floppy
>>
>> For that reason, a while ago udev switched to acpi aliases entirely,
>> and dropped all pnp: usage. The acpi aliases can handle multi-values
>> just fine with single strings like:
>> Â $ cat /sys/bus/acpi/devices/LEN0006:00/modalias
>> Â acpi:LEN0006:PNP0F13:
>>
>> Â alias acpi*:PNP0700:* floppy
>
> Then why didn't you change the pnp modalias format to be more like the ACPI
> one?

I'm all for doing that, but the current ones are used in old shell
script hacks and custom modprobe configs. Not sure, if that is still
something we need to care about. As mentioned, for that reason,
upstream udev dropped all that a while ago and supports only acpi
aliases today. At the moment we decide not to care about the possible
old users anymore, we could change the pnp aliases to a sane format.

> (I know nothing about ACPI or PNP, so maybe I'm missing something fundamental).

I think you don't miss anything, it's just a bit hard sometimes to get
rid of old users, even when they use the stuff in a wrong way. :)

Thanks,
Kay
--
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/