* [PATCH] HID: logitech-hidpp: Silence intermittent get_battery_capacity errors
@ 2019-11-14 14:30 Hans de Goede
2019-11-15 12:19 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2019-11-14 14:30 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires; +Cc: Hans de Goede, linux-input
My Logitech M185 (PID:4038) 2.4 GHz wireless HID++ mouse is causing
intermittent errors like these in the log:
[11091.034857] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
[12388.031260] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
[16613.718543] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
[23529.938728] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
We are already silencing error-code 0x09 (HIDPP_ERROR_RESOURCE_ERROR)
errors in other places, lets do the same in
hidpp20_batterylevel_get_battery_capacity to remove these harmless,
but scary looking errors from the dmesg output.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/hid/hid-logitech-hidpp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 8e91e2f06cb4..cd9193078525 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -1102,6 +1102,9 @@ static int hidpp20_batterylevel_get_battery_capacity(struct hidpp_device *hidpp,
ret = hidpp_send_fap_command_sync(hidpp, feature_index,
CMD_BATTERY_LEVEL_STATUS_GET_BATTERY_LEVEL_STATUS,
NULL, 0, &response);
+ /* Ignore these intermittent errors */
+ if (ret == HIDPP_ERROR_RESOURCE_ERROR)
+ return -EIO;
if (ret > 0) {
hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
__func__, ret);
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: logitech-hidpp: Silence intermittent get_battery_capacity errors
2019-11-14 14:30 [PATCH] HID: logitech-hidpp: Silence intermittent get_battery_capacity errors Hans de Goede
@ 2019-11-15 12:19 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2019-11-15 12:19 UTC (permalink / raw)
To: Hans de Goede; +Cc: Benjamin Tissoires, linux-input
On Thu, 14 Nov 2019, Hans de Goede wrote:
> My Logitech M185 (PID:4038) 2.4 GHz wireless HID++ mouse is causing
> intermittent errors like these in the log:
>
> [11091.034857] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
> [12388.031260] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
> [16613.718543] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
> [23529.938728] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09
>
> We are already silencing error-code 0x09 (HIDPP_ERROR_RESOURCE_ERROR)
> errors in other places, lets do the same in
> hidpp20_batterylevel_get_battery_capacity to remove these harmless,
> but scary looking errors from the dmesg output.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/hid/hid-logitech-hidpp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
> index 8e91e2f06cb4..cd9193078525 100644
> --- a/drivers/hid/hid-logitech-hidpp.c
> +++ b/drivers/hid/hid-logitech-hidpp.c
> @@ -1102,6 +1102,9 @@ static int hidpp20_batterylevel_get_battery_capacity(struct hidpp_device *hidpp,
> ret = hidpp_send_fap_command_sync(hidpp, feature_index,
> CMD_BATTERY_LEVEL_STATUS_GET_BATTERY_LEVEL_STATUS,
> NULL, 0, &response);
> + /* Ignore these intermittent errors */
> + if (ret == HIDPP_ERROR_RESOURCE_ERROR)
> + return -EIO;
> if (ret > 0) {
> hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n",
> __func__, ret);
Applied, thanks Hans.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-15 12:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-14 14:30 [PATCH] HID: logitech-hidpp: Silence intermittent get_battery_capacity errors Hans de Goede
2019-11-15 12:19 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).