Bug 216480 - Linux HID++ uses device quirks for smooth scrolling when it does not need to
Summary: Linux HID++ uses device quirks for smooth scrolling when it does not need to
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-13 13:47 UTC by Peter F. Patel-Schneider
Modified: 2023-02-03 16:38 UTC (History)
4 users (show)

See Also:
Kernel Version: 5.19.7
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Peter F. Patel-Schneider 2022-09-13 13:47:23 UTC
Modern Logitech HID++ devices use features.  The features a device supports can be discovered by querying the device so device quirks are not needed.

The Linux HID++ driver https://github.com/torvalds/linux/blob/master/drivers/hid/hid-logitech-hidpp.c performs feature discovery for battery information, querying the device to find out which, if any, battery feature the device provides but it does not perform feature discovery for the features that can be used to provide high-resolution scrolling.   

Instead of requiring quirks (sometimes two separate quirk records) for each device that has one of these features the driver should perform feature discovery so that quirks are not required for devices that have high-resolution scrolling features.
Comment 2 Paolo Mainardi 2022-12-22 12:24:38 UTC
Hi everyone! 

Just testing the new feature landed on 6.1, i have a quite recent product, MX Master 3s and using it with the USB dongle.

For some reasons it seems that hi-res scrolling feature is not detected, this is what i see from dmesg:

[  +4.639482] usb 3-2.2: new full-speed USB device number 16 using xhci_hcd

[  +0.126857] usb 3-2.2: New USB device found, idVendor=046d, idProduct=c548, bcdDevice= 5.01

[  +0.000013] usb 3-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0

[  +0.000004] usb 3-2.2: Product: USB Receiver

[  +0.000003] usb 3-2.2: Manufacturer: Logitech

[  +0.121338] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:08.1/0000:06:00.4/usb3/3-2/3-2.2/3-2.2:1.0/0003:046D:C548.0011/input/input36

[  +0.055811] hid-generic 0003:046D:C548.0011: input,hidraw1: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input0

[  +0.004048] input: Logitech USB Receiver Mouse as /devices/pci0000:00/0000:00:08.1/0000:06:00.4/usb3/3-2/3-2.2/3-2.2:1.1/0003:046D:C548.0012/input/input37

[  +0.000259] input: Logitech USB Receiver Consumer Control as /devices/pci0000:00/0000:00:08.1/0000:06:00.4/usb3/3-2/3-2.2/3-2.2:1.1/0003:046D:C548.0012/input/input38

[  +0.055315] input: Logitech USB Receiver System Control as /devices/pci0000:00/0000:00:08.1/0000:06:00.4/usb3/3-2/3-2.2/3-2.2:1.1/0003:046D:C548.0012/input/input39

[  +0.000305] hid-generic 0003:046D:C548.0012: input,hidraw2: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input1

[  +0.003891] hid-generic 0003:046D:C548.0013: hiddev96,hidraw3: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input2

As you can see is missing the "Detected HID++ 2.0 hi-res scroll wheel".'

Let me know if you need something more from my side.
Comment 3 Paolo Mainardi 2022-12-22 12:31:36 UTC
I don't understand why it is recognized as "Keyboard" instead of "USB HID v1.11 Mouse" as the original patch:

[  +0.055811] hid-generic 0003:046D:C548.0011: input,hidraw1: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input0
[  +0.004048] input: Logitech USB Receiver Mouse as /devices/pci0000:00/0000:00:08.1/0000:06:00.4/usb3/3-2/3-2.2/3-2.2:1.1/0003:046D:C548.0012/input/input37
Comment 4 Paolo Mainardi 2022-12-22 12:37:06 UTC
Ok reading it better, i see this sequence:


[  +0.054822] hid-generic 0003:046D:C548.0014: input,hidraw1: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input0

And then:

[  +0.000167] hid-generic 0003:046D:C548.0015: input,hidraw2: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input1
[  +0.003455] hid-generic 0003:046D:C548.0016: hiddev96,hidraw3: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input2

So it is recognized as a mouse just after a fraction of time.

Another difference I see that is missing from my side is this line that I see instead on the patch's description:

[   57.472434] logitech-hidpp-device 0003:046D:406D.0006: HID++ 4.5 device connected.

Could be related to this ?
Comment 5 David Roth 2023-01-04 12:11:44 UTC
(In reply to Paolo Mainardi from comment #4)
> Ok reading it better, i see this sequence:
> 
> 
> [  +0.054822] hid-generic 0003:046D:C548.0014: input,hidraw1: USB HID v1.11
> Keyboard [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input0
> 
> And then:
> 
> [  +0.000167] hid-generic 0003:046D:C548.0015: input,hidraw2: USB HID v1.11
> Mouse [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input1
> [  +0.003455] hid-generic 0003:046D:C548.0016: hiddev96,hidraw3: USB HID
> v1.11 Device [Logitech USB Receiver] on usb-0000:06:00.4-2.2/input2
> 
> So it is recognized as a mouse just after a fraction of time.
> 
> Another difference I see that is missing from my side is this line that I
> see instead on the patch's description:
> 
> [   57.472434] logitech-hidpp-device 0003:046D:406D.0006: HID++ 4.5 device
> connected.
> 
> Could be related to this ?

You will only see those messages regarding detection of the high res wheel if you enable debug logging e.g. on a kernel with CONFIG_DYNAMIC_DEBUG enabled you can reload the module with modprobe hid-logitech-hidpp dyndbg=p and will see the debugging messages
Comment 6 Stefan Brüns 2023-01-08 18:20:06 UTC
(In reply to David Roth from comment #5)
 
> You will only see those messages regarding detection of the high res wheel
> if you enable debug logging e.g. on a kernel with CONFIG_DYNAMIC_DEBUG
> enabled you can reload the module with modprobe hid-logitech-hidpp dyndbg=p
> and will see the debugging messages

much simpler than unloading and reloading:

echo 'file hid-logitech-hidpp.c +p' > /sys/kernel/debug/dynamic_debug/control
grep -i hidpp /sys/kernel/debug/dynamic_debug/control 

(mount location of the debugfs may vary dependent on the distribution, see output of `mount -t debugfs`.)
Comment 7 Bastien Nocera 2023-01-17 10:25:58 UTC
(In reply to Paolo Mainardi from comment #2)
> Hi everyone! 
> 
> Just testing the new feature landed on 6.1, i have a quite recent product,
> MX Master 3s and using it with the USB dongle.

This bug should have been closed when the patch landed. Please file a new bug.
Comment 8 Bastien Nocera 2023-02-03 16:38:52 UTC
Implemented in 908d325e1665b2781085580070554cbbe5fc3c89, with fixes for HID++ 1.0 devices in 31421a0fe20cea0b9cdb02e91f5cb37ed06d1d99 and a work-around for some dual-USB/Unifying devices in https://bugzilla.kernel.org/show_bug.cgi?id=216885

Note You need to log in before you can comment on or make changes to this bug.