Patch "HID: logitech-hidpp: Do not flood kernel log" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    HID: logitech-hidpp: Do not flood kernel log

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hid-logitech-hidpp-do-not-flood-kernel-log.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1269736fafb51379faf1323ea43d3ce1da039aae
Author: Oleksandr Natalenko <oleksandr@xxxxxxxxxxxxxx>
Date:   Mon Jan 29 17:49:31 2024 +0100

    HID: logitech-hidpp: Do not flood kernel log
    
    [ Upstream commit 411a20db905b44e18cc9129b745f1d5deba4eae5 ]
    
    Since commit 680ee411a98e ("HID: logitech-hidpp: Fix connect event race")
    the following messages appear in the kernel log from time to time:
    
    logitech-hidpp-device 0003:046D:408A.0005: HID++ 4.5 device connected.
    logitech-hidpp-device 0003:046D:408A.0005: HID++ 4.5 device connected.
    logitech-hidpp-device 0003:046D:4051.0006: Disconnected
    logitech-hidpp-device 0003:046D:408A.0005: Disconnected
    
    As discussed, print the first per-device "device connected" message
    at info level, demoting subsequent messages to debug level. Also,
    demote the "Disconnected message" to debug level unconditionally.
    
    Link: https://lore.kernel.org/lkml/3277085.44csPzL39Z@xxxxxxxxxxxxxx/
    Signed-off-by: Oleksandr Natalenko <oleksandr@xxxxxxxxxxxxxx>
    Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
    Signed-off-by: Jiri Kosina <jkosina@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 6ef0c88e3e60a..d2f3f234f29de 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -203,6 +203,8 @@ struct hidpp_device {
 	struct hidpp_scroll_counter vertical_wheel_counter;
 
 	u8 wireless_feature_index;
+
+	bool connected_once;
 };
 
 /* HID++ 1.0 error codes */
@@ -988,8 +990,13 @@ static int hidpp_root_get_protocol_version(struct hidpp_device *hidpp)
 	hidpp->protocol_minor = response.rap.params[1];
 
 print_version:
-	hid_info(hidpp->hid_dev, "HID++ %u.%u device connected.\n",
-		 hidpp->protocol_major, hidpp->protocol_minor);
+	if (!hidpp->connected_once) {
+		hid_info(hidpp->hid_dev, "HID++ %u.%u device connected.\n",
+			 hidpp->protocol_major, hidpp->protocol_minor);
+		hidpp->connected_once = true;
+	} else
+		hid_dbg(hidpp->hid_dev, "HID++ %u.%u device connected.\n",
+			 hidpp->protocol_major, hidpp->protocol_minor);
 	return 0;
 }
 
@@ -4184,7 +4191,7 @@ static void hidpp_connect_event(struct work_struct *work)
 	/* Get device version to check if it is connected */
 	ret = hidpp_root_get_protocol_version(hidpp);
 	if (ret) {
-		hid_info(hidpp->hid_dev, "Disconnected\n");
+		hid_dbg(hidpp->hid_dev, "Disconnected\n");
 		if (hidpp->battery.ps) {
 			hidpp->battery.online = false;
 			hidpp->battery.status = POWER_SUPPLY_STATUS_UNKNOWN;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux