]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: logitech-hidpp: Do not assume FAP in hidpp_send_message_sync()
authorMavroudis Chatzilazaridis <mavchatz@protonmail.com>
Thu, 2 Oct 2025 19:30:58 +0000 (19:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:28 +0000 (14:02 +0100)
commit4e02cff54ba0a45db8d1a9d472cfcb321bfb017b
tree55d7c930f1c5f3e2a2e51eb6c53fe92ffd884e14
parentac35eed93429cdfe8b5ad71d167b8dd33bdcaeee
HID: logitech-hidpp: Do not assume FAP in hidpp_send_message_sync()

[ Upstream commit aba7963544d47d82cdf36602a6678a093af0299d ]

Currently, hidpp_send_message_sync() retries sending the message when the
device returns a busy error code, specifically HIDPP20_ERROR_BUSY, which
has a different meaning under RAP. This ends up being a problem because
this function is used for both FAP and RAP messages.

This issue is not noticeable on older receivers with unreachable devices
since they return HIDPP_ERROR_RESOURCE_ERROR (0x09), which is not equal to
HIDPP20_ERROR_BUSY (0x08).

However, newer receivers return HIDPP_ERROR_UNKNOWN_DEVICE (0x08) which
happens to equal to HIDPP20_ERROR_BUSY, causing unnecessary retries when
the device is not actually busy.

This is resolved by checking if the error response is FAP or RAP and
picking the respective ERROR_BUSY code.

Fixes: 60165ab774cb ("HID: logitech-hidpp: rework one more time the retries attempts")
Signed-off-by: Mavroudis Chatzilazaridis <mavchatz@protonmail.com>
Tested-by: Stuart Hayhurst <stuart.a.hayhurst@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-logitech-hidpp.c