]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
USB: core: ratelimit cabling message
authorOliver Neukum <oneukum@suse.com>
Fri, 5 Jun 2026 09:00:58 +0000 (11:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jul 2026 15:19:17 +0000 (17:19 +0200)
If a cable is bad, it stays bad. There is no need to flood the log with
messages about it. So go for a ratelimited version.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://patch.msgid.link/20260605090110.1514785-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c

index 24960ba9caa915f12a4f5582269808fdebd1ee11..5262e11c12cd3aa112c6913024b1c6c05bc1440c 100644 (file)
@@ -3148,7 +3148,7 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
                delay = HUB_LONG_RESET_TIME;
        }
 
-       dev_err(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n");
+       dev_err_ratelimited(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n");
 
 done:
        if (status == 0) {