git: 0f0379fa5581 - main - hid: Add recently imported drivers to NOTES

Vladimir Kondratyev vladimir at kondratyev.su
Tue Jan 12 01:19:30 UTC 2021


On 12.01.2021 03:30, John Baldwin wrote:
> On 1/11/21 12:08 PM, Vladimir Kondratyev wrote:
>> On 11.01.2021 21:11, John Baldwin wrote:
>>> On 1/10/21 11:20 AM, Vladimir Kondratyev wrote:
>>>> The branch main has been updated by wulf:
>>>>
>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=0f0379fa5581c6b89d22bd041f7443581bac616c
>>>>
>>>> commit 0f0379fa5581c6b89d22bd041f7443581bac616c
>>>> Author:     Vladimir Kondratyev <wulf at FreeBSD.org>
>>>> AuthorDate: 2021-01-09 12:07:19 +0000
>>>> Commit:     Vladimir Kondratyev <wulf at FreeBSD.org>
>>>> CommitDate: 2021-01-10 19:17:20 +0000
>>>>
>>>>     hid: Add recently imported drivers to NOTES
>>>>     
>>>>     Reviewed by:    hselasky
>>>>     Differential revision:  https://reviews.freebsd.org/D28060
>>>
>>> Now that we have entries in NOTES, can we perhaps remove HID_DEBUG
>>> from GENERIC
>>
>> Some part of HID code belonged to USB previously. That is why HID_DEBUG
>> line was inherited from already existing USB_DEBUG in GENERIC.
>> If enabling of USB_DEBUG had no relation to HID, we can delete HID_DEBUG.
> 
> Ah, I see.  I am somewhat surprised USB_DEBUG is on by default, but
> HID_DEBUG being consistent with USB_DEBUG seems ok.
> 
>>> along with commented out drivers related to usbhid?
>>
>> Yes we can. I'll add mention about minimal number of devices/options
>> required to enable usbhid reliably to NOTES and delete driver lines from
>> GENERIC.
>> I do not want to delete options USBHID_ENABLED as it is about priority
>> rather than features. May be, it have a sense to change it name to
>> USBHID_DISABLED and enable by default.
> 
> I think it would be nice to turn it into a tunable sysctl (hw.usb.prefer_usbhid
> or some such) and let usbhid_probe() check the variable associated with that
> to determine it's return value.

This is good idea. Thanks!

  What I don't understand is why the other USB
> drivers exclude their PnP info when this option is enabled?  Can't you just
> leave the PnP info enabled and depend on return values of the probe routines to
> DTRT?  It does mean devmatch might load a ukbd.ko that doesn't get used?  It
> seems like what you kind of want is to have the PnP info present in both drivers
> (ukbd.ko and usbhid.ko for example) and let them both load for now but let the
> tunable's value determine which driver "wins" (USB drivers are relatively
> small, and people who really want exactly one can either compile the desired
> one into a custom kernel or use MODULES_OVERRIDE or the like to select which
> modules to build).  Eventually if usbhid supplants the other drivers they can be
> retired, but the tunable would allow them to coexist for a while, and changing the
> default would just be changing the default value of that tunable.

I did it to block surprising automatic attachment of low priority driver
on kldunloading of high priority one. But while it is very annoying
during development, it is irrelevant in everyday use. I will remove PnP
info #ifdef-s as in conjunction with aforementioned tunable sysctl, it
will allows avoid kernel recompilation.


More information about the dev-commits-src-all mailing list