lkml.org 
[lkml]   [2008]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] usbcore: Limit number of 'unable to enumerate USB device' messages
In my system, a number of messages that state "unable to enumerate USB device"
are logged. These are intermittent and likely due to some race condition
at bootup.

Some of these happen when the EHCI driver is loaded after UHCI or OHCI, which
causes the device to be switched away from the other controller that's trying
to enumerate it, at least momentarily. This type of message is logged at most
once for each hub and occurs in about 70% of my reboots.

A more insidious form of the message occurs hundreds of times in about 10% of
reboots. They continue until the system is rebooted. This patch limits the
number of these messages to 20. Once the actual cause of this message is
located, this patch can be reverted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Index: linux-2.6/drivers/usb/core/hub.c
===================================================================
--- linux-2.6.orig/drivers/usb/core/hub.c
+++ linux-2.6/drivers/usb/core/hub.c
@@ -2746,6 +2746,7 @@ static void hub_port_connect_change(stru
le16_to_cpu(hub->descriptor->wHubCharacteristics);
struct usb_device *udev;
int status, i;
+ static int enum_count;

dev_dbg (hub_dev,
"port %d, status %04x, change %04x, %s\n",
@@ -2945,8 +2946,9 @@ loop:
if (hub->hdev->parent ||
!hcd->driver->port_handed_over ||
!(hcd->driver->port_handed_over)(hcd, port1))
- dev_err(hub_dev, "unable to enumerate USB device on port %d\n",
- port1);
+ if (enum_count++ < 20)
+ dev_err(hub_dev, "unable to enumerate USB device on "
+ "port %d\n", port1);

done:
hub_port_disable(hub, port1, 1);



\
 
 \ /
  Last update: 2008-10-24 01:37    [W:0.053 / U:4.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site