aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2014-07-14 09:39:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-18 19:18:10 -0400
commit5ee0f803cc3a0738a63288e4a2f453c85889fbda (patch)
treec6a9f62adeaeb9e8208b1d1f1e40724aa4bddc32
parent934ef5aca9daea10507eebcbd0fb8f6d57d55359 (diff)
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>
-rw-r--r--drivers/usb/core/hub.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 88f1db27e0af..2c2f67ec36ad 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4547,6 +4547,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
4547 struct usb_hcd *hcd = bus_to_hcd(hdev->bus); 4547 struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
4548 struct usb_port *port_dev = hub->ports[port1 - 1]; 4548 struct usb_port *port_dev = hub->ports[port1 - 1];
4549 struct usb_device *udev = port_dev->child; 4549 struct usb_device *udev = port_dev->child;
4550 static int unreliable_port = -1;
4550 4551
4551 /* Disconnect any existing devices under this port */ 4552 /* Disconnect any existing devices under this port */
4552 if (udev) { 4553 if (udev) {
@@ -4567,10 +4568,14 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
4567 USB_PORT_STAT_C_ENABLE)) { 4568 USB_PORT_STAT_C_ENABLE)) {
4568 status = hub_port_debounce_be_stable(hub, port1); 4569 status = hub_port_debounce_be_stable(hub, port1);
4569 if (status < 0) { 4570 if (status < 0) {
4570 if (status != -ENODEV && printk_ratelimit()) 4571 if (status != -ENODEV &&
4571 dev_err(&port_dev->dev, 4572 port1 != unreliable_port &&
4572 "connect-debounce failed\n"); 4573 printk_ratelimit())
4574 dev_err(&udev->dev, "connect-debounce failed, port %d disabled\n",
4575 port1);
4576
4573 portstatus &= ~USB_PORT_STAT_CONNECTION; 4577 portstatus &= ~USB_PORT_STAT_CONNECTION;
4578 unreliable_port = port1;
4574 } else { 4579 } else {
4575 portstatus = status; 4580 portstatus = status;
4576 } 4581 }