Commit 196260c1 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] usbcore, diagnostic tweaks

Minor updates for better diagnostics from usbcore:

 - Only print ep0 maxpacket when it's not what we first tried

 - have khubd say when it's looking at a hub

 - When warning about synchronous control or bulk timeouts,
   report the program that triggered the message.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 7b6e44e7
...@@ -2244,8 +2244,8 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port, ...@@ -2244,8 +2244,8 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port,
/* Should we verify that the value is valid? */ /* Should we verify that the value is valid? */
i = udev->descriptor.bMaxPacketSize0; i = udev->descriptor.bMaxPacketSize0;
dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
if (udev->epmaxpacketin[0] != i) { if (udev->epmaxpacketin[0] != i) {
dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
usb_disable_endpoint(udev, 0 + USB_DIR_IN); usb_disable_endpoint(udev, 0 + USB_DIR_IN);
usb_disable_endpoint(udev, 0 + USB_DIR_OUT); usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
udev->epmaxpacketin[0] = udev->epmaxpacketout[0] = i; udev->epmaxpacketin[0] = udev->epmaxpacketout[0] = i;
...@@ -2551,6 +2551,14 @@ static void hub_events(void) ...@@ -2551,6 +2551,14 @@ static void hub_events(void)
usb_get_dev(hdev); usb_get_dev(hdev);
spin_unlock_irq(&hub_event_lock); spin_unlock_irq(&hub_event_lock);
dev_dbg(hub_dev, "state %d ports %d chg %04x evt %04x\n",
hdev->state, hub->descriptor
? hub->descriptor->bNbrPorts
: 0,
/* NOTE: expects max 15 ports... */
(u16) hub->change_bits[0],
(u16) hub->event_bits[0]);
/* Lock the device, then check to see if we were /* Lock the device, then check to see if we were
* disconnected while waiting for the lock to succeed. */ * disconnected while waiting for the lock to succeed. */
if (locktree(hdev) < 0) if (locktree(hdev) < 0)
......
...@@ -34,8 +34,9 @@ static void timeout_kill(unsigned long data) ...@@ -34,8 +34,9 @@ static void timeout_kill(unsigned long data)
{ {
struct urb *urb = (struct urb *) data; struct urb *urb = (struct urb *) data;
dev_warn(&urb->dev->dev, "%s timeout on ep%d%s\n", dev_warn(&urb->dev->dev, "%s timeout from '%s' on ep%d%s\n",
usb_pipecontrol(urb->pipe) ? "control" : "bulk", usb_pipecontrol(urb->pipe) ? "control" : "bulk",
current->comm,
usb_pipeendpoint(urb->pipe), usb_pipeendpoint(urb->pipe),
usb_pipein(urb->pipe) ? "in" : "out"); usb_pipein(urb->pipe) ? "in" : "out");
usb_unlink_urb(urb); usb_unlink_urb(urb);
......
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