Page MenuHomeFreeBSD

acpi(4): Add _CID to PNP info string
ClosedPublic

Authored by cem on Dec 17 2019, 3:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 29, 4:03 PM
Unknown Object (File)
Tue, Jun 11, 8:52 PM
Unknown Object (File)
Wed, Jun 5, 3:36 AM
Unknown Object (File)
May 3 2024, 2:13 PM
Unknown Object (File)
Apr 30 2024, 4:19 AM
Unknown Object (File)
Apr 23 2024, 9:47 PM
Unknown Object (File)
Feb 27 2024, 6:12 AM
Unknown Object (File)
Feb 1 2024, 11:14 PM
Subscribers
None

Details

Summary

While a given ACPI device may have 0-N compatibility IDs, in practice most
seem to have 0 or 1. If one is present, emit it as part of the PNP info
string associated with a device. This could enable MODULE_PNP_INFO-based
automatic kldload for ACPI drivers associated with a given _CID (but without
a good _HID or _UID identifier).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think just doing the first one is probably fine. You could also do a comma-separated list? A comma separated list would require using
something like strlcat perhaps, but that wouldn't be the worst thing.

In D22846#500393, @jhb wrote:

I think just doing the first one is probably fine. You could also do a comma-separated list? A comma separated list would require using
something like strlcat perhaps, but that wouldn't be the worst thing.

Devmatch isn't set up to match on comma-separated values, so I don't think there's much use in adding that at this time. I.e., if a device provided several CIDs, PNP info of "... _CID=foo,bar,baz", a MODULE_PNP_INFO("Z:_CID") match with a table including "foo", "bar", "baz" wouldn't match; only a table entry of "foo,bar,baz" would. Support for comma-separated values could definitely be added, but I would lean towards not doing so at this time.

(I'm also not to worried about just the first one — it seems like most devices have 0 or 1 _CIDs. When we find a device that needs matching on a 2nd _CID, we can implement that support.)

This revision is now accepted and ready to land.Dec 17 2019, 11:32 PM

I'll echo what jhb said...
And note that devmatch doesn't know CID and hid are the same namespace for auto loading. I'm unsure how to communicate that to devmatch.... that shouldn't block this commit though

This revision was automatically updated to reflect the committed changes.