On Mon, 13 Mar 2006 17:26:44 -0500 Bill Nottingham wrote: > Kay Sievers ([email protected]) said: > > > See: > > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=178998 I have written a comment in that bugzilla entry, but it is probably too terse, so I'll try to explain the problem and my proposed solution better. > > > This doesn't work for everything. > > > > Sure not, and I don't think "everything" in PnP will ever work. :) But > > it does the same as the modalias patch to the kernel we are talking about. > > There are device table entries completely missing and some other don't > > match. Some of them can be fixed by adding the aliases as modprobe.conf > > entries. > > Well, it's just that if this is the solution proposed, I'd like it if > it worked for any of the people who are seeing problems - in our bugs, > it hasn't helped any of them yet. There are two kinds of PNP drivers: 1) PNP device drivers, which use struct pnp_driver. These drivers use struct pnp_device_id in id_table entries; struct pnp_device_id contains a single device ID field which is used for matching. Aliases for these drivers have the form: pnp:dXXXYYYY* where XXXYYYY is the PNP ID which is matched. 2) PNP card drivers, which use struct pnp_card_driver. These drivers use struct pnp_card_device_id in id_table entries; struct pnp_card_device_id contains ID for the card itself and a variable number of logical device IDs. drivers/pnp/card.c:match_card() uses these rules for matching struct pnp_card_device_id to a device: a) the card IDs must match; b) all device IDs mentioned in struct pnp_card_device_id must be present in the card, but can be in any order (and there may be more devices than listed in the ID table). Aliases for card drivers currently have the form: pnp:cXXXYYYYdXXXYYYYdXXXYYYY* The first "cXXXYYYY" part is the card ID, and "dXXXYYYY" parts are device IDs (there may be up to PNP_MAX_DEVICES == 8 of them). Now, for the drivers of the first type the only problem is that the devices can have several compatible IDs in addition to the primary ID, and this requires either a multiline "modalias" attribute, or a helper script to call modprobe multiple times with the pnp:dXXXYYYY alias for all available IDs. Drivers of the second type - PNP card drivers - are only used for isapnp (pnpbios and pnpacpi have only plain devices). Cards itself have only a single ID (there are no compatible IDs for cards), but every logical device on a card can have up to DEVICE_COUNT_COMPATIBLE == 4 compatible IDs in addition to the primary ID. (BTW, #define DEVICE_COUNT_COMPATIBLE 4 is duplicated in <linux/pci.h> and <linux/isapnp.h> - if these values were different, it would be a nasty bug.) For the card drivers, in addition to the problem with compatible IDs, we have another problem - the alias format for them is wrong! The problem is that if device IDs in the alias happen to be in a different order than the same IDs in the actual device (or even in the same order, but some devices are not mentioned in the ID table), fnmatch() used by modprobe will not match this alias. To solve this problem, I suggest to do this: 1) Change the alias format for PNP card drivers to require logical device IDs to be sorted, and add an "*" before every device ID part. The alias format becomes: pnp:cXXXYYYY*dXXXYYYY*dXXXYYYY* 2) Update scripts/mod/file2alias.c:do_pnp_card_entry() to write the new alias format (it should sort device IDs - no need to change all drivers to list device IDs in sorted order and create potential for bugs when someone adds a non-sorted entry). 3) Update /etc/udev/isapnp script mentioned in bugzilla entry to sort device ID values before concatenating them. After dust settles, we can then add "modalias" attribute generation for PNP card devices to the kernel - note that this attribute would have only a single value which would list the card ID and all (primary and compatible) IDs of all logical devices in sorted order. BTW, we can change the alias format for PNP device drivers to pnp:*dXXXYYYY* (note the additional "*" before the device ID). This would allow us to have a single-value "modalias" attribute for PNP logical devices too - it would have the form pnp:dXXXYYYYdXXXYYYYdXXXYYYY (listing all IDs, in this case sorting is not required, because each driver will match at most only a single dXXXYYYY entry).
Attachment:
pgpGh9PfygI5o.pgp
Description: PGP signature
- Follow-Ups:
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Pierre Ossman <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- References:
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Kay Sievers <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Pierre Ossman <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Kay Sievers <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Pierre Ossman <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Pierre Ossman <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Andrew Morton <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Pierre Ossman <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Kay Sievers <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Bill Nottingham <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Kay Sievers <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- From: Bill Nottingham <[email protected]>
- Re: [PATCH] [PNP] 'modalias' sysfs export
- Prev by Date: Re: [2.6.16-rc6 patch] remove sleep_avg multiplier
- Next by Date: Re: does swsusp suck after resume for you? [was Re: Faster resuming of suspend technology.]
- Previous by thread: Re: [PATCH] [PNP] 'modalias' sysfs export
- Next by thread: Re: [PATCH] [PNP] 'modalias' sysfs export
- Index(es):