linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: logitech-dj: stop G602 mouse dmesg flooding
@ 2025-02-25  2:01 thomas
  0 siblings, 0 replies; only message in thread
From: thomas @ 2025-02-25  2:01 UTC (permalink / raw)
  To: linux-input; +Cc: thomas

The Logitech G602 mouse seems to send a 128 report on every button
press, which is undefined behavior and results in a dmesg log entry each
time any button on the mouse is clicked (left/right/scroll click or any
other macro/function buttons). This causes dmesg to be flooded with
repeated entries of the following content pretty much constantly:

    Unexpected input report number 128

This commit checks for this exact scenario, and quietly ignores it
instead of logging the error. Actual mouse functionality is not
affected.

Link: https://lore.kernel.org/lkml/cb14d9fb-9928-4c62-a087-b1a54202d65a@redhat.com/

Signed-off-by: thomas <me@thomasanderson.cloud>
---
 drivers/hid/hid-logitech-dj.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 34fa71ceec2b..bea03df74fb4 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -1160,6 +1160,16 @@ static void logi_dj_recv_forward_input_report(struct hid_device *hdev,
 	int i;
 
 	if (report > REPORT_TYPE_RFREPORT_LAST) {
+		/*
+		 * G602 mouse may send a 128 report on every click, which is undefined
+		 * behavior and spams the log. Ignore it.
+		 */
+		if (report == 128 &&
+		    hdev->vendor == USB_VENDOR_ID_LOGITECH &&
+		    hdev->product == 0xc537) {
+			return;
+		}
+
 		hid_err(hdev, "Unexpected input report number %d\n", report);
 		return;
 	}
-- 
2.43.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-25  2:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25  2:01 [PATCH] HID: logitech-dj: stop G602 mouse dmesg flooding thomas

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).