Commit 11ca032
HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only
Restarting IO causes 2 problems:
1. Some devices do not like IO being restarted this was addressed in
commit 498ba20 ("HID: logitech-hidpp: Don't restart communication
if not necessary"), but that change has issues of its own and needs to
be reverted.
2. Restarting IO and specifically calling hid_device_io_stop() causes
received packets to be missed, which may cause connect-events to
get missed.
Restarting IO was introduced in commit 91cf9a9 ("HID: logitech-hidpp:
make .probe usbhid capable") to allow to retrieve the device's name and
serial number and store these in hdev->name and hdev->uniq before
connecting any hid subdrivers (hid-input, hidraw) exporting this info
to userspace.
But this does not require restarting IO, this merely requires deferring
calling hid_connect(). Calling hid_hw_start() with a connect-mask of
0 makes it skip calling hid_connect(), so hidpp_probe() can simply call
hid_connect() later without needing to restart IO.
Remove the stop + restart of IO and instead just call hid_connect() later
to avoid the issues caused by restarting IO.
Now that IO is no longer stopped, hid_hw_close() must be called at the end
of probe() to balance the hid_hw_open() done at the beginning probe().
This series has been tested on the following devices:
Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0)
Logitech M720 Triathlon (bluetooth, HID++ 4.5)
Logitech M720 Triathlon (unifying, HID++ 4.5)
Logitech K400 Pro (unifying, HID++ 4.1)
Logitech K270 (eQUAD nano Lite, HID++ 2.0)
Logitech M185 (eQUAD nano Lite, HID++ 4.5)
Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0)
Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0)
And by bentiss:
Logitech Touchpad T650 (unifying)
Logitech Touchpad T651 (bluetooth)
Logitech MX Master 3B (BLE)
Logitech G403 (plain USB / Gaming receiver)
Fixes: 498ba20 ("HID: logitech-hidpp: Don't restart communication if not necessary")
Suggested-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231010102029.111003-2-hdegoede@redhat.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>1 parent bab19d1 commit 11ca032
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4460 | 4460 | | |
4461 | 4461 | | |
4462 | 4462 | | |
4463 | | - | |
4464 | | - | |
| 4463 | + | |
| 4464 | + | |
| 4465 | + | |
| 4466 | + | |
4465 | 4467 | | |
4466 | 4468 | | |
4467 | 4469 | | |
| |||
4519 | 4521 | | |
4520 | 4522 | | |
4521 | 4523 | | |
4522 | | - | |
4523 | | - | |
4524 | | - | |
4525 | | - | |
4526 | | - | |
4527 | 4524 | | |
4528 | 4525 | | |
4529 | 4526 | | |
4530 | 4527 | | |
4531 | | - | |
| 4528 | + | |
4532 | 4529 | | |
4533 | | - | |
4534 | | - | |
| 4530 | + | |
| 4531 | + | |
4535 | 4532 | | |
4536 | 4533 | | |
4537 | 4534 | | |
| |||
4543 | 4540 | | |
4544 | 4541 | | |
4545 | 4542 | | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
4546 | 4548 | | |
4547 | 4549 | | |
4548 | 4550 | | |
| |||
0 commit comments