Re: Trouble adding QUIRK_ALWAYS_POLL to quirky USB mouse

From: Alan Stern
Date: Wed Mar 04 2020 - 10:05:25 EST


On Tue, 3 Mar 2020, Tony Fischetti wrote:

> Hi all,
>
> I have a lenovo pixart mouse (vendorId: 0x17ef, productId: 0x608d)
> that's afflicted with the apparently common problem of disconnecting
> and re-connecting every minute, each time incrementing the device
> number
>
> I tried to apply a patch very much like the one in this commit with
> the identical problem: dcf768b0ac868630e7bdb6f2f1c9fe72788012fa
> The particular patch I applied appears at the end of this email (not
> meant to be submitted/applied, just as a reference)
>
> The problem is that when I apply the patch and boot the new kernel,
> the quirk appears not to have been registered (it doesn't appear in
> /sys/module/usbhid/parameters/quirks)
> It is only when I add the kernel boot parameter
> usbhid.quirks=0x17ef:0x608d:0x00000400 that it appears to be working
>
> Anyone have any ideas on how to fix this? I'd like to submit a patch
> fixing this issue once I get it sorted out

If you have usbhid loaded as a module instead of built into the kernel,
then it probably is getting loaded from the initramfs. If you didn't
rebuild the initramfs image after creating the new kernel, you would
end up loading the original module without the new quirk entry.

It's easy enough to test this. After booting, do:

rmmod usbhid ; modprobe usbhid

and see if the quirk entry then shows up in sysfs.

Alan Stern