dect
/
linux-2.6
Archived
13
0
Fork 0

USB: Dealias -110 code (more complete)

The purpose of this patch is to split off the case when a device does
not reply on the lower level (which is reported by HC hardware), and
a case when the device accepted the request, but does not reply at
upper level. This redefinition allows to diagnose issues easier,
without asking the user if the -110 happened "immediately".

The usbmon splits such cases already thanks to its timestamp, but
it's not always available.

I adjusted all drivers which I found affected (by searching for "urb").
Out of tree drivers may suffer a little bit, but I do not expect much
breakage. At worst they may print a few messages.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Pete Zaitcev 2006-09-18 22:49:02 -07:00 committed by Greg Kroah-Hartman
parent ec17cf1cfe
commit 38e2bfc94e
24 changed files with 48 additions and 60 deletions

View File

@ -98,13 +98,13 @@ one or more packets could finish before an error stops further endpoint I/O.
error, a failure to respond (often caused by error, a failure to respond (often caused by
device disconnect), or some other fault. device disconnect), or some other fault.
-ETIMEDOUT (**) No response packet received within the prescribed -ETIME (**) No response packet received within the prescribed
bus turn-around time. This error may instead be bus turn-around time. This error may instead be
reported as -EPROTO or -EILSEQ. reported as -EPROTO or -EILSEQ.
Note that the synchronous USB message functions -ETIMEDOUT Synchronous USB message functions use this code
also use this code to indicate timeout expired to indicate timeout expired before the transfer
before the transfer completed. completed, and no other error was reported by HC.
-EPIPE (**) Endpoint stalled. For non-control endpoints, -EPIPE (**) Endpoint stalled. For non-control endpoints,
reset this status with usb_clear_halt(). reset this status with usb_clear_halt().
@ -163,6 +163,3 @@ usb_get_*/usb_set_*():
usb_control_msg(): usb_control_msg():
usb_bulk_msg(): usb_bulk_msg():
-ETIMEDOUT Timeout expired before the transfer completed. -ETIMEDOUT Timeout expired before the transfer completed.
In the future this code may change to -ETIME,
whose definition is a closer match to this sort
of error.

View File

@ -192,7 +192,7 @@ static char *get_usb_statmsg(int status)
return "bit stuffing error, timeout, or unknown USB error"; return "bit stuffing error, timeout, or unknown USB error";
case -EILSEQ: case -EILSEQ:
return "CRC mismatch, timeout, or unknown USB error"; return "CRC mismatch, timeout, or unknown USB error";
case -ETIMEDOUT: case -ETIME:
return "timed out"; return "timed out";
case -EPIPE: case -EPIPE:
return "endpoint stalled"; return "endpoint stalled";

View File

@ -137,11 +137,11 @@ static struct hfcusb_symbolic_list urb_errlist[] = {
{-ENXIO, "URB already queued"}, {-ENXIO, "URB already queued"},
{-EFBIG, "Too much ISO frames requested"}, {-EFBIG, "Too much ISO frames requested"},
{-ENOSR, "Buffer error (overrun)"}, {-ENOSR, "Buffer error (overrun)"},
{-EPIPE, "Specified endpoint is stalled (device not responding)"}, {-EPIPE, "Specified endpoint is stalled"},
{-EOVERFLOW, "Babble (bad cable?)"}, {-EOVERFLOW, "Babble (bad cable?)"},
{-EPROTO, "Bit-stuff error (bad cable?)"}, {-EPROTO, "Bit-stuff error (bad cable?)"},
{-EILSEQ, "CRC/Timeout"}, {-EILSEQ, "CRC or missing token"},
{-ETIMEDOUT, "NAK (device does not respond)"}, {-ETIME, "Device did not respond"},
{-ESHUTDOWN, "Device unplugged"}, {-ESHUTDOWN, "Device unplugged"},
{-1, NULL} {-1, NULL}
}; };

View File

@ -80,7 +80,6 @@ static void dvb_usb_urb_complete(struct urb *urb, struct pt_regs *ptregs)
switch (urb->status) { switch (urb->status) {
case 0: /* success */ case 0: /* success */
case -ETIMEDOUT: /* NAK */
break; break;
case -ECONNRESET: /* kill */ case -ECONNRESET: /* kill */
case -ENOENT: case -ENOENT:

View File

@ -215,7 +215,7 @@ static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs)
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
case -ETIMEDOUT: case -ETIME:
/* this urb is dead, cleanup */ /* this urb is dead, cleanup */
dprintk("%s:urb shutting down with status: %d\n", dprintk("%s:urb shutting down with status: %d\n",
__FUNCTION__, urb->status); __FUNCTION__, urb->status);

View File

@ -301,10 +301,11 @@ static struct symbolic_list senlist[] = {
static struct symbolic_list urb_errlist[] = { static struct symbolic_list urb_errlist[] = {
{ -ENOSR, "Buffer error (overrun)" }, { -ENOSR, "Buffer error (overrun)" },
{ -EPIPE, "Stalled (device not responding)" }, { -EPIPE, "Stalled (device not responding)" },
{ -EOVERFLOW, "Babble (bad cable?)" }, { -EOVERFLOW, "Babble (device sends too much data)" },
{ -EPROTO, "Bit-stuff error (bad cable?)" }, { -EPROTO, "Bit-stuff error (bad cable?)" },
{ -EILSEQ, "CRC/Timeout" }, { -EILSEQ, "CRC/Timeout (bad cable?)" },
{ -ETIMEDOUT, "NAK (device does not respond)" }, { -ETIME, "Device does not respond to token" },
{ -ETIMEDOUT, "Device does not respond to command" },
{ -1, NULL } { -1, NULL }
}; };

View File

@ -711,7 +711,7 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
case -EOVERFLOW: errmsg = "Babble (bad cable?)"; break; case -EOVERFLOW: errmsg = "Babble (bad cable?)"; break;
case -EPROTO: errmsg = "Bit-stuff error (bad cable?)"; break; case -EPROTO: errmsg = "Bit-stuff error (bad cable?)"; break;
case -EILSEQ: errmsg = "CRC/Timeout (could be anything)"; break; case -EILSEQ: errmsg = "CRC/Timeout (could be anything)"; break;
case -ETIMEDOUT: errmsg = "NAK (device does not respond)"; break; case -ETIME: errmsg = "Device does not respond"; break;
} }
PWC_DEBUG_FLOW("pwc_isoc_handler() called with status %d [%s].\n", urb->status, errmsg); PWC_DEBUG_FLOW("pwc_isoc_handler() called with status %d [%s].\n", urb->status, errmsg);
/* Give up after a number of contiguous errors on the USB bus. /* Give up after a number of contiguous errors on the USB bus.

View File

@ -586,15 +586,14 @@ static struct w9968cf_symbolic_list urb_errlist[] = {
{ -EFBIG, "Too much ISO frames requested" }, { -EFBIG, "Too much ISO frames requested" },
{ -ENOSR, "Buffer error (overrun)" }, { -ENOSR, "Buffer error (overrun)" },
{ -EPIPE, "Specified endpoint is stalled (device not responding)"}, { -EPIPE, "Specified endpoint is stalled (device not responding)"},
{ -EOVERFLOW, "Babble (bad cable?)" }, { -EOVERFLOW, "Babble (too much data)" },
{ -EPROTO, "Bit-stuff error (bad cable?)" }, { -EPROTO, "Bit-stuff error (bad cable?)" },
{ -EILSEQ, "CRC/Timeout" }, { -EILSEQ, "CRC/Timeout" },
{ -ETIMEDOUT, "NAK (device does not respond)" }, { -ETIME, "Device does not respond to token" },
{ -ETIMEDOUT, "Device does not respond to command" },
{ -1, NULL } { -1, NULL }
}; };
/**************************************************************************** /****************************************************************************
* Memory management functions * * Memory management functions *
****************************************************************************/ ****************************************************************************/

View File

@ -671,10 +671,8 @@ static void irda_usb_net_timeout(struct net_device *netdev)
* Jean II */ * Jean II */
done = 1; done = 1;
break; break;
case -ECONNABORTED: /* -103 */ case -ECONNRESET:
case -ECONNRESET: /* -104 */ case -ENOENT: /* urb unlinked by us */
case -ETIMEDOUT: /* -110 */
case -ENOENT: /* -2 (urb unlinked by us) */
default: /* ??? - Play safe */ default: /* ??? - Play safe */
urb->status = 0; urb->status = 0;
netif_wake_queue(self->netdev); netif_wake_queue(self->netdev);
@ -712,10 +710,8 @@ static void irda_usb_net_timeout(struct net_device *netdev)
* Jean II */ * Jean II */
done = 1; done = 1;
break; break;
case -ECONNABORTED: /* -103 */ case -ECONNRESET:
case -ECONNRESET: /* -104 */ case -ENOENT: /* urb unlinked by us */
case -ETIMEDOUT: /* -110 */
case -ENOENT: /* -2 (urb unlinked by us) */
default: /* ??? - Play safe */ default: /* ??? - Play safe */
if(skb != NULL) { if(skb != NULL) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
@ -845,14 +841,14 @@ static void irda_usb_receive(struct urb *urb, struct pt_regs *regs)
self->stats.rx_crc_errors++; self->stats.rx_crc_errors++;
/* Also precursor to a hot-unplug on UHCI. */ /* Also precursor to a hot-unplug on UHCI. */
/* Fallthrough... */ /* Fallthrough... */
case -ECONNRESET: /* -104 */ case -ECONNRESET:
/* Random error, if I remember correctly */ /* Random error, if I remember correctly */
/* uhci_cleanup_unlink() is going to kill the Rx /* uhci_cleanup_unlink() is going to kill the Rx
* URB just after we return. No problem, at this * URB just after we return. No problem, at this
* point the URB will be idle ;-) - Jean II */ * point the URB will be idle ;-) - Jean II */
case -ESHUTDOWN: /* -108 */ case -ESHUTDOWN:
/* That's usually a hot-unplug. Submit will fail... */ /* That's usually a hot-unplug. Submit will fail... */
case -ETIMEDOUT: /* -110 */ case -ETIME:
/* Usually precursor to a hot-unplug on OHCI. */ /* Usually precursor to a hot-unplug on OHCI. */
default: default:
self->stats.rx_errors++; self->stats.rx_errors++;

View File

@ -119,7 +119,7 @@ static void zd1201_usbfree(struct urb *urb, struct pt_regs *regs)
switch(urb->status) { switch(urb->status) {
case -EILSEQ: case -EILSEQ:
case -ENODEV: case -ENODEV:
case -ETIMEDOUT: case -ETIME:
case -ENOENT: case -ENOENT:
case -EPIPE: case -EPIPE:
case -EOVERFLOW: case -EOVERFLOW:
@ -201,7 +201,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs)
switch(urb->status) { switch(urb->status) {
case -EILSEQ: case -EILSEQ:
case -ENODEV: case -ENODEV:
case -ETIMEDOUT: case -ETIME:
case -ENOENT: case -ENOENT:
case -EPIPE: case -EPIPE:
case -EOVERFLOW: case -EOVERFLOW:

View File

@ -233,7 +233,7 @@ static const int cc_to_error[16] = {
/* Bit Stuff */ -EPROTO, /* Bit Stuff */ -EPROTO,
/* Data Togg */ -EILSEQ, /* Data Togg */ -EILSEQ,
/* Stall */ -EPIPE, /* Stall */ -EPIPE,
/* DevNotResp */ -ETIMEDOUT, /* DevNotResp */ -ETIME,
/* PIDCheck */ -EPROTO, /* PIDCheck */ -EPROTO,
/* UnExpPID */ -EPROTO, /* UnExpPID */ -EPROTO,
/* DataOver */ -EOVERFLOW, /* DataOver */ -EOVERFLOW,

View File

@ -159,7 +159,7 @@ static const int cc_to_error [16] = {
/* Bit Stuff */ -EPROTO, /* Bit Stuff */ -EPROTO,
/* Data Togg */ -EILSEQ, /* Data Togg */ -EILSEQ,
/* Stall */ -EPIPE, /* Stall */ -EPIPE,
/* DevNotResp */ -ETIMEDOUT, /* DevNotResp */ -ETIME,
/* PIDCheck */ -EPROTO, /* PIDCheck */ -EPROTO,
/* UnExpPID */ -EPROTO, /* UnExpPID */ -EPROTO,
/* DataOver */ -EOVERFLOW, /* DataOver */ -EOVERFLOW,

View File

@ -597,7 +597,7 @@ done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank, struct pt_regs *regs)
/* error? retry, until "3 strikes" */ /* error? retry, until "3 strikes" */
} else if (++ep->error_count >= 3) { } else if (++ep->error_count >= 3) {
if (status & SL11H_STATMASK_TMOUT) if (status & SL11H_STATMASK_TMOUT)
urbstat = -ETIMEDOUT; urbstat = -ETIME;
else if (status & SL11H_STATMASK_OVF) else if (status & SL11H_STATMASK_OVF)
urbstat = -EOVERFLOW; urbstat = -EOVERFLOW;
else else

View File

@ -1023,7 +1023,8 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs)
return; return;
case -EILSEQ: /* protocol error or unplug */ case -EILSEQ: /* protocol error or unplug */
case -EPROTO: /* protocol error or unplug */ case -EPROTO: /* protocol error or unplug */
case -ETIMEDOUT: /* NAK */ case -ETIME: /* protocol error or unplug */
case -ETIMEDOUT: /* Should never happen, but... */
clear_bit(HID_IN_RUNNING, &hid->iofl); clear_bit(HID_IN_RUNNING, &hid->iofl);
hid_io_error(hid); hid_io_error(hid);
return; return;

View File

@ -87,7 +87,7 @@ static void itmtouch_irq(struct urb *urb, struct pt_regs *regs)
case 0: case 0:
/* success */ /* success */
break; break;
case -ETIMEDOUT: case -ETIME:
/* this urb is timing out */ /* this urb is timing out */
dbg("%s - urb timed out - was the device unplugged?", dbg("%s - urb timed out - was the device unplugged?",
__FUNCTION__); __FUNCTION__);

View File

@ -107,7 +107,7 @@ static void mtouchusb_irq(struct urb *urb, struct pt_regs *regs)
case 0: case 0:
/* success */ /* success */
break; break;
case -ETIMEDOUT: case -ETIME:
/* this urb is timing out */ /* this urb is timing out */
dbg("%s - urb timed out - was the device unplugged?", dbg("%s - urb timed out - was the device unplugged?",
__FUNCTION__); __FUNCTION__);

View File

@ -201,7 +201,7 @@ static void touchkit_irq(struct urb *urb, struct pt_regs *regs)
case 0: case 0:
/* success */ /* success */
break; break;
case -ETIMEDOUT: case -ETIME:
/* this urb is timing out */ /* this urb is timing out */
dbg("%s - urb timed out - was the device unplugged?", dbg("%s - urb timed out - was the device unplugged?",
__FUNCTION__); __FUNCTION__);

View File

@ -508,7 +508,7 @@ static void usbtouch_irq(struct urb *urb, struct pt_regs *regs)
case 0: case 0:
/* success */ /* success */
break; break;
case -ETIMEDOUT: case -ETIME:
/* this urb is timing out */ /* this urb is timing out */
dbg("%s - urb timed out - was the device unplugged?", dbg("%s - urb timed out - was the device unplugged?",
__FUNCTION__); __FUNCTION__);

View File

@ -806,7 +806,7 @@ static void auerbuf_releasebuf( pauerbuf_t bp)
0 Initial, OK 0 Initial, OK
-EINPROGRESS during submission until end -EINPROGRESS during submission until end
-ENOENT if urb is unlinked -ENOENT if urb is unlinked
-ETIMEDOUT Transfer timed out, NAK -ETIME Device did not respond
-ENOMEM Memory Overflow -ENOMEM Memory Overflow
-ENODEV Specified USB-device or bus doesn't exist -ENODEV Specified USB-device or bus doesn't exist
-ENXIO URB already queued -ENXIO URB already queued
@ -832,7 +832,7 @@ static int auerswald_status_retry (int status)
{ {
switch (status) { switch (status) {
case 0: case 0:
case -ETIMEDOUT: case -ETIME:
case -EOVERFLOW: case -EOVERFLOW:
case -EAGAIN: case -EAGAIN:
case -EPIPE: case -EPIPE:

View File

@ -619,7 +619,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
switch (urb->status) { switch (urb->status) {
case 0: case 0:
break; break;
case -ETIMEDOUT: case -ETIME:
if (netif_msg_rx_err(pegasus)) if (netif_msg_rx_err(pegasus))
pr_debug("%s: reset MAC\n", net->name); pr_debug("%s: reset MAC\n", net->name);
pegasus->flags &= ~PEGASUS_RX_BUSY; pegasus->flags &= ~PEGASUS_RX_BUSY;

View File

@ -438,7 +438,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
break; break;
case -ENOENT: case -ENOENT:
return; /* the urb is in unlink state */ return; /* the urb is in unlink state */
case -ETIMEDOUT: case -ETIME:
warn("may be reset is needed?.."); warn("may be reset is needed?..");
goto goon; goto goon;
default: default:

View File

@ -425,9 +425,9 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
// we get controller i/o faults during khubd disconnect() delays. // we get controller i/o faults during khubd disconnect() delays.
// throttle down resubmits, to avoid log floods; just temporarily, // throttle down resubmits, to avoid log floods; just temporarily,
// so we still recover when the fault isn't a khubd delay. // so we still recover when the fault isn't a khubd delay.
case -EPROTO: // ehci case -EPROTO:
case -ETIMEDOUT: // ohci case -ETIME:
case -EILSEQ: // uhci case -EILSEQ:
dev->stats.rx_errors++; dev->stats.rx_errors++;
if (!timer_pending (&dev->delay)) { if (!timer_pending (&dev->delay)) {
mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES);
@ -821,9 +821,9 @@ static void tx_complete (struct urb *urb, struct pt_regs *regs)
// like rx, tx gets controller i/o faults during khubd delays // like rx, tx gets controller i/o faults during khubd delays
// and so it uses the same throttling mechanism. // and so it uses the same throttling mechanism.
case -EPROTO: // ehci case -EPROTO:
case -ETIMEDOUT: // ohci case -ETIME:
case -EILSEQ: // uhci case -EILSEQ:
if (!timer_pending (&dev->delay)) { if (!timer_pending (&dev->delay)) {
mod_timer (&dev->delay, mod_timer (&dev->delay,
jiffies + THROTTLE_JIFFIES); jiffies + THROTTLE_JIFFIES);

View File

@ -294,11 +294,6 @@ static int interpret_urb_result(struct us_data *us, unsigned int pipe,
return USB_STOR_XFER_ERROR; return USB_STOR_XFER_ERROR;
return USB_STOR_XFER_STALLED; return USB_STOR_XFER_STALLED;
/* timeout or excessively long NAK */
case -ETIMEDOUT:
US_DEBUGP("-- timeout or NAK\n");
return USB_STOR_XFER_ERROR;
/* babble - the device tried to send more than we wanted to read */ /* babble - the device tried to send more than we wanted to read */
case -EOVERFLOW: case -EOVERFLOW:
US_DEBUGP("-- babble\n"); US_DEBUGP("-- babble\n");

View File

@ -181,9 +181,9 @@ static int snd_usbmidi_urb_error(int status)
case -ENODEV: case -ENODEV:
return -ENODEV; return -ENODEV;
/* errors that might occur during unplugging */ /* errors that might occur during unplugging */
case -EPROTO: /* EHCI */ case -EPROTO:
case -ETIMEDOUT: /* OHCI */ case -ETIME:
case -EILSEQ: /* UHCI */ case -EILSEQ:
return -EIO; return -EIO;
default: default:
snd_printk(KERN_ERR "urb status %d\n", status); snd_printk(KERN_ERR "urb status %d\n", status);