Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usbcore: don't log on consecutive debounce failures of the same port

Some laptops have an internal port for a BT device which picks
up noise when the kill switch is used, but not enough to trigger
printk_rlimit(). So we shouldn't log consecutive faults of this kind.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
5ee0f803 934ef5ac

+8 -3
+8 -3
drivers/usb/core/hub.c
··· 4547 4547 struct usb_hcd *hcd = bus_to_hcd(hdev->bus); 4548 4548 struct usb_port *port_dev = hub->ports[port1 - 1]; 4549 4549 struct usb_device *udev = port_dev->child; 4550 + static int unreliable_port = -1; 4550 4551 4551 4552 /* Disconnect any existing devices under this port */ 4552 4553 if (udev) { ··· 4568 4567 USB_PORT_STAT_C_ENABLE)) { 4569 4568 status = hub_port_debounce_be_stable(hub, port1); 4570 4569 if (status < 0) { 4571 - if (status != -ENODEV && printk_ratelimit()) 4572 - dev_err(&port_dev->dev, 4573 - "connect-debounce failed\n"); 4570 + if (status != -ENODEV && 4571 + port1 != unreliable_port && 4572 + printk_ratelimit()) 4573 + dev_err(&udev->dev, "connect-debounce failed, port %d disabled\n", 4574 + port1); 4575 + 4574 4576 portstatus &= ~USB_PORT_STAT_CONNECTION; 4577 + unreliable_port = port1; 4575 4578 } else { 4576 4579 portstatus = status; 4577 4580 }