HID: logitech-hidpp: Handle timeout differently from busy
authorBastien Nocera <hadess@hadess.net>
Wed, 31 May 2023 08:24:28 +0000 (10:24 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 31 May 2023 14:08:24 +0000 (16:08 +0200)
commit6199d23c91ce53bfed455f09a8c5ed170d516824
treebdca9b3a269da8191bf336bb9f165ff8f751454b
parent16a9c24f24fbe4564284eb575b18cc20586b9270
HID: logitech-hidpp: Handle timeout differently from busy

If an attempt at contacting a receiver or a device fails because the
receiver or device never responds, don't restart the communication, only
restart it if the receiver or device answers that it's busy, as originally
intended.

This was the behaviour on communication timeout before commit 586e8fede795
("HID: logitech-hidpp: Retry commands when device is busy").

This fixes some overly long waits in a critical path on boot, when
checking whether the device is connected by getting its HID++ version.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
Suggested-by: Mark Lord <mlord@pobox.com>
Fixes: 586e8fede795 ("HID: logitech-hidpp: Retry commands when device is busy")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217412
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-logitech-hidpp.c