diff options
author | Pete Zaitcev <zaitcev@redhat.com> | 2006-09-18 22:49:02 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 11:59:00 -0700 |
commit | 38e2bfc94e95dd6005fdaf40dfec0157396741da (patch) | |
tree | 1cc927239e3369ec7ce4920b1347dd8bc504bb2d /drivers | |
parent | ec17cf1cfe0b557210b27313bd584e9b5187d4ca (diff) | |
download | op-kernel-dev-38e2bfc94e95dd6005fdaf40dfec0157396741da.zip op-kernel-dev-38e2bfc94e95dd6005fdaf40dfec0157396741da.tar.gz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/isdn/gigaset/bas-gigaset.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_usb.h | 6 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-urb.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb/ttusb-dec/ttusb_dec.c | 2 | ||||
-rw-r--r-- | drivers/media/video/ov511.c | 7 | ||||
-rw-r--r-- | drivers/media/video/pwc/pwc-if.c | 2 | ||||
-rw-r--r-- | drivers/media/video/w9968cf.c | 7 | ||||
-rw-r--r-- | drivers/net/irda/irda-usb.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/zd1201.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/isp116x.h | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci.h | 2 | ||||
-rw-r--r-- | drivers/usb/host/sl811-hcd.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 3 | ||||
-rw-r--r-- | drivers/usb/input/itmtouch.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/mtouchusb.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/touchkitusb.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/usbtouchscreen.c | 2 | ||||
-rw-r--r-- | drivers/usb/misc/auerswald.c | 4 | ||||
-rw-r--r-- | drivers/usb/net/pegasus.c | 2 | ||||
-rw-r--r-- | drivers/usb/net/rtl8150.c | 2 | ||||
-rw-r--r-- | drivers/usb/net/usbnet.c | 12 | ||||
-rw-r--r-- | drivers/usb/storage/transport.c | 5 |
22 files changed, 41 insertions, 50 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index 3845def..5cfbe6a 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c @@ -192,7 +192,7 @@ static char *get_usb_statmsg(int status) return "bit stuffing error, timeout, or unknown USB error"; case -EILSEQ: return "CRC mismatch, timeout, or unknown USB error"; - case -ETIMEDOUT: + case -ETIME: return "timed out"; case -EPIPE: return "endpoint stalled"; diff --git a/drivers/isdn/hisax/hfc_usb.h b/drivers/isdn/hisax/hfc_usb.h index ec52c1a..6349367 100644 --- a/drivers/isdn/hisax/hfc_usb.h +++ b/drivers/isdn/hisax/hfc_usb.h @@ -137,11 +137,11 @@ static struct hfcusb_symbolic_list urb_errlist[] = { {-ENXIO, "URB already queued"}, {-EFBIG, "Too much ISO frames requested"}, {-ENOSR, "Buffer error (overrun)"}, - {-EPIPE, "Specified endpoint is stalled (device not responding)"}, + {-EPIPE, "Specified endpoint is stalled"}, {-EOVERFLOW, "Babble (bad cable?)"}, {-EPROTO, "Bit-stuff error (bad cable?)"}, - {-EILSEQ, "CRC/Timeout"}, - {-ETIMEDOUT, "NAK (device does not respond)"}, + {-EILSEQ, "CRC or missing token"}, + {-ETIME, "Device did not respond"}, {-ESHUTDOWN, "Device unplugged"}, {-1, NULL} }; diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c index 9002f35..88b2837 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c @@ -80,7 +80,6 @@ static void dvb_usb_urb_complete(struct urb *urb, struct pt_regs *ptregs) switch (urb->status) { case 0: /* success */ - case -ETIMEDOUT: /* NAK */ break; case -ECONNRESET: /* kill */ case -ENOENT: diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 6c1cb77..c9d66354 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -215,7 +215,7 @@ static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - case -ETIMEDOUT: + case -ETIME: /* this urb is dead, cleanup */ dprintk("%s:urb shutting down with status: %d\n", __FUNCTION__, urb->status); diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c index 1b07a61..5d8cd28 100644 --- a/drivers/media/video/ov511.c +++ b/drivers/media/video/ov511.c @@ -301,10 +301,11 @@ static struct symbolic_list senlist[] = { static struct symbolic_list urb_errlist[] = { { -ENOSR, "Buffer error (overrun)" }, { -EPIPE, "Stalled (device not responding)" }, - { -EOVERFLOW, "Babble (bad cable?)" }, + { -EOVERFLOW, "Babble (device sends too much data)" }, { -EPROTO, "Bit-stuff error (bad cable?)" }, - { -EILSEQ, "CRC/Timeout" }, - { -ETIMEDOUT, "NAK (device does not respond)" }, + { -EILSEQ, "CRC/Timeout (bad cable?)" }, + { -ETIME, "Device does not respond to token" }, + { -ETIMEDOUT, "Device does not respond to command" }, { -1, NULL } }; diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index d470394..53c4b57 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c @@ -711,7 +711,7 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs) case -EOVERFLOW: errmsg = "Babble (bad cable?)"; break; case -EPROTO: errmsg = "Bit-stuff error (bad cable?)"; 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); /* Give up after a number of contiguous errors on the USB bus. diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c index 20f211b..2912326 100644 --- a/drivers/media/video/w9968cf.c +++ b/drivers/media/video/w9968cf.c @@ -586,15 +586,14 @@ static struct w9968cf_symbolic_list urb_errlist[] = { { -EFBIG, "Too much ISO frames requested" }, { -ENOSR, "Buffer error (overrun)" }, { -EPIPE, "Specified endpoint is stalled (device not responding)"}, - { -EOVERFLOW, "Babble (bad cable?)" }, + { -EOVERFLOW, "Babble (too much data)" }, { -EPROTO, "Bit-stuff error (bad cable?)" }, { -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 } }; - - /**************************************************************************** * Memory management functions * ****************************************************************************/ diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 2a0d538..383cef1 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c @@ -671,10 +671,8 @@ static void irda_usb_net_timeout(struct net_device *netdev) * Jean II */ done = 1; break; - case -ECONNABORTED: /* -103 */ - case -ECONNRESET: /* -104 */ - case -ETIMEDOUT: /* -110 */ - case -ENOENT: /* -2 (urb unlinked by us) */ + case -ECONNRESET: + case -ENOENT: /* urb unlinked by us */ default: /* ??? - Play safe */ urb->status = 0; netif_wake_queue(self->netdev); @@ -712,10 +710,8 @@ static void irda_usb_net_timeout(struct net_device *netdev) * Jean II */ done = 1; break; - case -ECONNABORTED: /* -103 */ - case -ECONNRESET: /* -104 */ - case -ETIMEDOUT: /* -110 */ - case -ENOENT: /* -2 (urb unlinked by us) */ + case -ECONNRESET: + case -ENOENT: /* urb unlinked by us */ default: /* ??? - Play safe */ if(skb != NULL) { 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++; /* Also precursor to a hot-unplug on UHCI. */ /* Fallthrough... */ - case -ECONNRESET: /* -104 */ + case -ECONNRESET: /* Random error, if I remember correctly */ /* uhci_cleanup_unlink() is going to kill the Rx * URB just after we return. No problem, at this * point the URB will be idle ;-) - Jean II */ - case -ESHUTDOWN: /* -108 */ + case -ESHUTDOWN: /* That's usually a hot-unplug. Submit will fail... */ - case -ETIMEDOUT: /* -110 */ + case -ETIME: /* Usually precursor to a hot-unplug on OHCI. */ default: self->stats.rx_errors++; diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index c52e9bcf..f50ec10 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c @@ -119,7 +119,7 @@ static void zd1201_usbfree(struct urb *urb, struct pt_regs *regs) switch(urb->status) { case -EILSEQ: case -ENODEV: - case -ETIMEDOUT: + case -ETIME: case -ENOENT: case -EPIPE: case -EOVERFLOW: @@ -201,7 +201,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs) switch(urb->status) { case -EILSEQ: case -ENODEV: - case -ETIMEDOUT: + case -ETIME: case -ENOENT: case -EPIPE: case -EOVERFLOW: diff --git a/drivers/usb/host/isp116x.h b/drivers/usb/host/isp116x.h index a1b7c38..b91e2ed 100644 --- a/drivers/usb/host/isp116x.h +++ b/drivers/usb/host/isp116x.h @@ -233,7 +233,7 @@ static const int cc_to_error[16] = { /* Bit Stuff */ -EPROTO, /* Data Togg */ -EILSEQ, /* Stall */ -EPIPE, - /* DevNotResp */ -ETIMEDOUT, + /* DevNotResp */ -ETIME, /* PIDCheck */ -EPROTO, /* UnExpPID */ -EPROTO, /* DataOver */ -EOVERFLOW, diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 650d1bf..93fdc3c 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -159,7 +159,7 @@ static const int cc_to_error [16] = { /* Bit Stuff */ -EPROTO, /* Data Togg */ -EILSEQ, /* Stall */ -EPIPE, - /* DevNotResp */ -ETIMEDOUT, + /* DevNotResp */ -ETIME, /* PIDCheck */ -EPROTO, /* UnExpPID */ -EPROTO, /* DataOver */ -EOVERFLOW, diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 8c17da3..3a586aa 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c @@ -597,7 +597,7 @@ done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank, struct pt_regs *regs) /* error? retry, until "3 strikes" */ } else if (++ep->error_count >= 3) { if (status & SL11H_STATMASK_TMOUT) - urbstat = -ETIMEDOUT; + urbstat = -ETIME; else if (status & SL11H_STATMASK_OVF) urbstat = -EOVERFLOW; else diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index fc5b662..2a3e9e9b 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c @@ -1023,7 +1023,8 @@ static void hid_irq_in(struct urb *urb, struct pt_regs *regs) return; case -EILSEQ: /* 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); hid_io_error(hid); return; diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c index 86acb5f..61966d7 100644 --- a/drivers/usb/input/itmtouch.c +++ b/drivers/usb/input/itmtouch.c @@ -87,7 +87,7 @@ static void itmtouch_irq(struct urb *urb, struct pt_regs *regs) case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index a9ccda8..5dce951 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c @@ -107,7 +107,7 @@ static void mtouchusb_irq(struct urb *urb, struct pt_regs *regs) case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index 0149043..30b9f82 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c @@ -201,7 +201,7 @@ static void touchkit_irq(struct urb *urb, struct pt_regs *regs) case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c index a1be784..4640d10 100644 --- a/drivers/usb/input/usbtouchscreen.c +++ b/drivers/usb/input/usbtouchscreen.c @@ -508,7 +508,7 @@ static void usbtouch_irq(struct urb *urb, struct pt_regs *regs) case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c index 4a329d8..4fd2110 100644 --- a/drivers/usb/misc/auerswald.c +++ b/drivers/usb/misc/auerswald.c @@ -806,7 +806,7 @@ static void auerbuf_releasebuf( pauerbuf_t bp) 0 Initial, OK -EINPROGRESS during submission until end -ENOENT if urb is unlinked --ETIMEDOUT Transfer timed out, NAK +-ETIME Device did not respond -ENOMEM Memory Overflow -ENODEV Specified USB-device or bus doesn't exist -ENXIO URB already queued @@ -832,7 +832,7 @@ static int auerswald_status_retry (int status) { switch (status) { case 0: - case -ETIMEDOUT: + case -ETIME: case -EOVERFLOW: case -EAGAIN: case -EPIPE: diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index ab21f96..b8e25af 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c @@ -619,7 +619,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs) switch (urb->status) { case 0: break; - case -ETIMEDOUT: + case -ETIME: if (netif_msg_rx_err(pegasus)) pr_debug("%s: reset MAC\n", net->name); pegasus->flags &= ~PEGASUS_RX_BUSY; diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c index a72685b..2364c20 100644 --- a/drivers/usb/net/rtl8150.c +++ b/drivers/usb/net/rtl8150.c @@ -438,7 +438,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs) break; case -ENOENT: return; /* the urb is in unlink state */ - case -ETIMEDOUT: + case -ETIME: warn("may be reset is needed?.."); goto goon; default: diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index 8e8e74d..98a522f 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c @@ -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. // throttle down resubmits, to avoid log floods; just temporarily, // so we still recover when the fault isn't a khubd delay. - case -EPROTO: // ehci - case -ETIMEDOUT: // ohci - case -EILSEQ: // uhci + case -EPROTO: + case -ETIME: + case -EILSEQ: dev->stats.rx_errors++; if (!timer_pending (&dev->delay)) { 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 // and so it uses the same throttling mechanism. - case -EPROTO: // ehci - case -ETIMEDOUT: // ohci - case -EILSEQ: // uhci + case -EPROTO: + case -ETIME: + case -EILSEQ: if (!timer_pending (&dev->delay)) { mod_timer (&dev->delay, jiffies + THROTTLE_JIFFIES); diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index d6acc92..f23514c 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -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_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 */ case -EOVERFLOW: US_DEBUGP("-- babble\n"); |