From: Mavroudis Chatzilazaridis Date: Thu, 2 Oct 2025 19:24:37 +0000 (+0000) Subject: HID: logitech-hidpp: Silence protocol errors on newer lightspeed receivers X-Git-Tag: v6.19-rc1~139^2~5^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55cafcac080a882fbeea1a49a7338211ff2494db;p=thirdparty%2Flinux.git HID: logitech-hidpp: Silence protocol errors on newer lightspeed receivers When logitech-hidpp tries to communicate with an unreachable device paired to a 046d:c547 lightspeed receiver, the following message is printed to the console: hidpp_root_get_protocol_version: received protocol error 0x08 This occurs because this receiver returns 0x08 (HIDPP_ERROR_UNKNOWN_DEVICE) when a device is unreachable, compared to 0x09 (HIDPP_ERROR_RESOURCE_ERROR) that the older receivers return. This patch silences this harmless error by treating HIDPP_ERROR_UNKNOWN_DEVICE the same as HIDPP_ERROR_RESOURCE_ERROR in hidpp_root_get_protocol_version(). There are other checks for HIDPP_ERROR_RESOURCE_ERROR found in battery-related functions, however this receiver does not trigger them when the device is disconnected. Signed-off-by: Mavroudis Chatzilazaridis Tested-by: Stuart Hayhurst Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index aaef405a717ee..1d46783384ede 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -969,7 +969,8 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp) } /* the device might not be connected */ - if (ret == HIDPP_ERROR_RESOURCE_ERROR) + if (ret == HIDPP_ERROR_RESOURCE_ERROR || + ret == HIDPP_ERROR_UNKNOWN_DEVICE) return -EIO; if (ret > 0) {