LKML Archive on
help / color / mirror / Atom feed
From: Larry Finger <>
To: Greg Kroah-Hartman <>
Cc:, LKML <>
Subject: [PATCH] usbcore: Limit number of 'unable to enumerate USB device' messages
Date: Thu, 23 Oct 2008 16:35:01 -0700	[thread overview]
Message-ID: <> (raw)

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 <>

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
 	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);

 	hub_port_disable(hub, port1, 1);

             reply	other threads:[~2008-10-23 23:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 23:35 Larry Finger [this message]
2008-10-23 23:36 ` Greg KH
2008-10-24 16:25   ` Larry Finger
2008-10-24 17:00     ` Greg KH
2008-10-25  3:16       ` Larry Finger
2008-10-25 14:59         ` Alan Stern
2008-10-27 16:37           ` Larry Finger
2008-10-24 13:57 ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] usbcore: Limit number of '\''unable to enumerate USB device'\'' messages' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).