Commit 6d481291 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

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

commit 5ee0f803 upstream.

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: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c2f31858
...@@ -4550,6 +4550,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, ...@@ -4550,6 +4550,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
struct usb_hcd *hcd = bus_to_hcd(hdev->bus); struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
struct usb_port *port_dev = hub->ports[port1 - 1]; struct usb_port *port_dev = hub->ports[port1 - 1];
struct usb_device *udev = port_dev->child; struct usb_device *udev = port_dev->child;
static int unreliable_port = -1;
/* Disconnect any existing devices under this port */ /* Disconnect any existing devices under this port */
if (udev) { if (udev) {
...@@ -4570,10 +4571,14 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, ...@@ -4570,10 +4571,14 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
USB_PORT_STAT_C_ENABLE)) { USB_PORT_STAT_C_ENABLE)) {
status = hub_port_debounce_be_stable(hub, port1); status = hub_port_debounce_be_stable(hub, port1);
if (status < 0) { if (status < 0) {
if (status != -ENODEV && printk_ratelimit()) if (status != -ENODEV &&
dev_err(&port_dev->dev, port1 != unreliable_port &&
"connect-debounce failed\n"); printk_ratelimit())
dev_err(&udev->dev, "connect-debounce failed, port %d disabled\n",
port1);
portstatus &= ~USB_PORT_STAT_CONNECTION; portstatus &= ~USB_PORT_STAT_CONNECTION;
unreliable_port = port1;
} else { } else {
portstatus = status; portstatus = status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment