core: usb: ratelimit cabling message
PATCH 1/1 core: usb: ratelimit cabling message
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.
--- drivers/usb/core/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/core/hub.c +1 -1
@@ -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 ) {
Signature · 1 line
2.54.0
Quoted 14 lines · Oliver Neukum
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 <[email protected]>--- drivers/usb/core/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/core/hub.c +0
-0
drivers/usb/core/hub.c static int hub_port_reset(struct usb_hub *hub, int port1, · line 3151
Quoted 5 lines
drivers/usb/core/hub.c +1
-1@@ -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" );
What causes hub_port_reset() to fail repeatedly enough for this to become a flood? Is there no bug to be fixed there?
IME this message doesn't show more often than all the other noise from failing enumeration.
Quoted 6 lines
drivers/usb/core/hub.c +0
-0done:if (status ==0 ) {Signature · 1 line
2.54.0
Quoted 2 lines · Michal Pecio
What causes
hub_port_reset()to fail repeatedly enough for this to become a flood? Is there no bug to be fixed there?
The cable is really quite bad. We are retrying forever. This message needs to be limited. Any other ideas?
Regards
Oliver