Re: [GIT PULL] HID for 6.13

From: Mike Galbraith
Date: Sun Nov 24 2024 - 21:01:17 EST


On Sun, 2024-11-24 at 09:01 +0100, Mike Galbraith wrote:
> On Fri, 2024-11-22 at 12:13 -0800, Linus Torvalds wrote:
> >
> > Any ideas? Does this make anybody go "Hmm, maybe ..."
>
> No, but my M215 had the same issue, it bisected to 6fd47effe92b, and
> revert via patch confirmed it.

Hopefully useful diag.

[ 3.769593] hid-generic 0003:046D:C52B.0003: HID-BPF toggled quirks on the device: 0800
[ 3.892715] hid-generic 0003:046D:C52B.0004: HID-BPF toggled quirks on the device: 0800
[ 3.895211] hid-generic 0003:046D:C52B.0005: HID-BPF toggled quirks on the device: 0800
[ 4.193277] hid-generic 0003:046D:401B.0006: HID-BPF toggled quirks on the device: 0800
[ 4.604769] hid-generic 0003:046D:4016.0007: HID-BPF toggled quirks on the device: 0800

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 81d6c734c8bc..3ae0eef2bb9b 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2710,6 +2710,18 @@ static int __hid_device_probe(struct hid_device *hdev, struct hid_driver *hdrv)
if (quirks ^ hdev->quirks)
hid_info(hdev, "HID-BPF toggled quirks on the device: %04x",
quirks ^ hdev->quirks);
+ } else {
+ unsigned int quirks = hid_lookup_quirk(hdev);
+
+ /*
+ * hdev->bpf_rsize became non-zero above, quirks set to 0, and we're
+ * back with quirks = HID_QUIRK_INPUT_PER_APP.. which terrifies mice?
+ */
+ if (quirks ^ hdev->quirks) {
+ hid_info(hdev, "HID-BPF toggled quirks on the device: %04x",
+ quirks ^ hdev->quirks);
+ hdev->quirks = quirks;
+ }
}

if (!hid_check_device_match(hdev, hdrv, &id))