On Tue, 1 Aug 2006 08:17:51 -0700, David Brownell <[EMAIL PROTECTED]> wrote:
> However a "grep ETIMEDOUT drivers/usb/*/*.[hc]" shows more than HID > needs to change, you should update all the relevant drivers not > just that one ... e.g. other input drivers and the network drivers > are all pretty good about robust fault recovery and this change > would cause breakage if you don't fix those too. I do not agree with your statement about the robust fault recovery. In fact, the vast majority of drivers are written poorly, which bites especially when they start using interrupt or ISO transfers. Only those drivers which get attention from Alan or Greg are more or less ok, e.g. usb-storage and hid - which I fixed the first time around. However, I see that I didn't do the due dilligence, and a replacement is needed in a few more places, notably in input/. Please see attached (cumulative). -- Pete diff -urp -X dontdiff linux-2.6.18-rc1/Documentation/usb/error-codes.txt linux-2.6.18-rc1-lem/Documentation/usb/error-codes.txt --- linux-2.6.18-rc1/Documentation/usb/error-codes.txt 2006-01-03 20:02:53.000000000 -0800 +++ linux-2.6.18-rc1-lem/Documentation/usb/error-codes.txt 2006-07-25 12:56:52.000000000 -0700 @@ -98,13 +98,13 @@ one or more packets could finish before error, a failure to respond (often caused by 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 reported as -EPROTO or -EILSEQ. - Note that the synchronous USB message functions - also use this code to indicate timeout expired - before the transfer completed. +-ETIMEDOUT Synchronous USB message functions use this code + to indicate timeout expired before the transfer + completed. -EPIPE (**) Endpoint stalled. For non-control endpoints, reset this status with usb_clear_halt(). diff -urp -X dontdiff linux-2.6.18-rc1/drivers/isdn/hisax/hfc_usb.h linux-2.6.18-rc1-lem/drivers/isdn/hisax/hfc_usb.h --- linux-2.6.18-rc1/drivers/isdn/hisax/hfc_usb.h 2006-01-03 20:03:15.000000000 -0800 +++ linux-2.6.18-rc1-lem/drivers/isdn/hisax/hfc_usb.h 2006-08-14 17:20:27.000000000 -0700 @@ -141,7 +141,7 @@ static struct hfcusb_symbolic_list urb_e {-EOVERFLOW, "Babble (bad cable?)"}, {-EPROTO, "Bit-stuff error (bad cable?)"}, {-EILSEQ, "CRC/Timeout"}, - {-ETIMEDOUT, "NAK (device does not respond)"}, + {-ETIME, "NAK (device does not respond)"}, {-ESHUTDOWN, "Device unplugged"}, {-1, NULL} }; diff -urp -X dontdiff linux-2.6.18-rc1/drivers/media/dvb/dvb-usb/dvb-usb-urb.c linux-2.6.18-rc1-lem/drivers/media/dvb/dvb-usb/dvb-usb-urb.c --- linux-2.6.18-rc1/drivers/media/dvb/dvb-usb/dvb-usb-urb.c 2006-06-21 14:14:28.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/media/dvb/dvb-usb/dvb-usb-urb.c 2006-08-14 17:17:27.000000000 -0700 @@ -80,7 +80,7 @@ static void dvb_usb_urb_complete(struct switch (urb->status) { case 0: /* success */ - case -ETIMEDOUT: /* NAK */ + case -ETIME: /* NAK */ break; case -ECONNRESET: /* kill */ case -ENOENT: diff -urp -X dontdiff linux-2.6.18-rc1/drivers/media/dvb/ttusb-dec/ttusb_dec.c linux-2.6.18-rc1-lem/drivers/media/dvb/ttusb-dec/ttusb_dec.c --- linux-2.6.18-rc1/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2006-07-09 17:54:12.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2006-08-14 17:18:34.000000000 -0700 @@ -215,7 +215,7 @@ static void ttusb_dec_handle_irq( struct 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 -urp -X dontdiff linux-2.6.18-rc1/drivers/net/irda/irda-usb.c linux-2.6.18-rc1-lem/drivers/net/irda/irda-usb.c --- linux-2.6.18-rc1/drivers/net/irda/irda-usb.c 2006-07-09 17:54:19.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/net/irda/irda-usb.c 2006-08-14 17:58:00.000000000 -0700 @@ -673,7 +673,6 @@ static void irda_usb_net_timeout(struct break; case -ECONNABORTED: /* -103 */ case -ECONNRESET: /* -104 */ - case -ETIMEDOUT: /* -110 */ case -ENOENT: /* -2 (urb unlinked by us) */ default: /* ??? - Play safe */ urb->status = 0; @@ -714,7 +713,6 @@ static void irda_usb_net_timeout(struct break; case -ECONNABORTED: /* -103 */ case -ECONNRESET: /* -104 */ - case -ETIMEDOUT: /* -110 */ case -ENOENT: /* -2 (urb unlinked by us) */ default: /* ??? - Play safe */ if(skb != NULL) { @@ -852,7 +850,7 @@ static void irda_usb_receive(struct urb * point the URB will be idle ;-) - Jean II */ case -ESHUTDOWN: /* -108 */ /* That's usually a hot-unplug. Submit will fail... */ - case -ETIMEDOUT: /* -110 */ + case -ETIME: /* -67 */ /* Usually precursor to a hot-unplug on OHCI. */ default: self->stats.rx_errors++; diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/core/message.c linux-2.6.18-rc1-lem/drivers/usb/core/message.c --- linux-2.6.18-rc1/drivers/usb/core/message.c 2006-07-09 17:54:35.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/core/message.c 2006-08-14 17:25:40.000000000 -0700 @@ -55,7 +55,6 @@ static int usb_start_wait_urb(struct urb } wait_for_completion(&done); status = urb->status; - /* note: HCDs return ETIMEDOUT for other reasons too */ if (status == -ECONNRESET) { dev_dbg(&urb->dev->dev, "%s timed out on ep%d%s len=%d/%d\n", diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/host/isp116x.h linux-2.6.18-rc1-lem/drivers/usb/host/isp116x.h --- linux-2.6.18-rc1/drivers/usb/host/isp116x.h 2006-03-27 07:45:22.000000000 -0800 +++ linux-2.6.18-rc1-lem/drivers/usb/host/isp116x.h 2006-07-25 12:48:39.000000000 -0700 @@ -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 -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/host/ohci.h linux-2.6.18-rc1-lem/drivers/usb/host/ohci.h --- linux-2.6.18-rc1/drivers/usb/host/ohci.h 2006-01-03 20:03:35.000000000 -0800 +++ linux-2.6.18-rc1-lem/drivers/usb/host/ohci.h 2006-07-27 18:23:03.000000000 -0700 @@ -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, @@ -388,6 +388,7 @@ struct ohci_hcd { u32 hc_control; /* copy of hc control reg */ unsigned long next_statechange; /* suspend/resume */ u32 fminterval; /* saved register */ + int irq_disabled; struct notifier_block reboot_notifier; diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/host/sl811-hcd.c linux-2.6.18-rc1-lem/drivers/usb/host/sl811-hcd.c --- linux-2.6.18-rc1/drivers/usb/host/sl811-hcd.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/host/sl811-hcd.c 2006-08-14 17:32:51.000000000 -0700 @@ -597,7 +597,7 @@ done(struct sl811 *sl811, struct sl811h_ /* 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 -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/input/hid-core.c linux-2.6.18-rc1-lem/drivers/usb/input/hid-core.c --- linux-2.6.18-rc1/drivers/usb/input/hid-core.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/input/hid-core.c 2006-08-14 17:51:12.000000000 -0700 @@ -1023,7 +1023,8 @@ static void hid_irq_in(struct urb *urb, 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 -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/input/itmtouch.c linux-2.6.18-rc1-lem/drivers/usb/input/itmtouch.c --- linux-2.6.18-rc1/drivers/usb/input/itmtouch.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/input/itmtouch.c 2006-08-14 17:48:58.000000000 -0700 @@ -87,7 +87,7 @@ static void itmtouch_irq(struct urb *urb case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/input/mtouchusb.c linux-2.6.18-rc1-lem/drivers/usb/input/mtouchusb.c --- linux-2.6.18-rc1/drivers/usb/input/mtouchusb.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/input/mtouchusb.c 2006-08-14 17:35:19.000000000 -0700 @@ -107,7 +107,7 @@ static void mtouchusb_irq(struct urb *ur case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/input/touchkitusb.c linux-2.6.18-rc1-lem/drivers/usb/input/touchkitusb.c --- linux-2.6.18-rc1/drivers/usb/input/touchkitusb.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/input/touchkitusb.c 2006-08-14 17:48:37.000000000 -0700 @@ -201,7 +201,7 @@ static void touchkit_irq(struct urb *urb case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/input/usbtouchscreen.c linux-2.6.18-rc1-lem/drivers/usb/input/usbtouchscreen.c --- linux-2.6.18-rc1/drivers/usb/input/usbtouchscreen.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/input/usbtouchscreen.c 2006-08-14 17:36:03.000000000 -0700 @@ -386,7 +386,7 @@ static void usbtouch_irq(struct urb *urb case 0: /* success */ break; - case -ETIMEDOUT: + case -ETIME: /* this urb is timing out */ dbg("%s - urb timed out - was the device unplugged?", __FUNCTION__); diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/misc/auerswald.c linux-2.6.18-rc1-lem/drivers/usb/misc/auerswald.c --- linux-2.6.18-rc1/drivers/usb/misc/auerswald.c 2006-06-21 14:14:52.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/misc/auerswald.c 2006-08-14 17:24:55.000000000 -0700 @@ -806,7 +806,7 @@ static void auerbuf_releasebuf( pauerbuf 0 Initial, OK -EINPROGRESS during submission until end -ENOENT if urb is unlinked --ETIMEDOUT Transfer timed out, NAK +-ETIME Too many NAKs (ohci only) -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 s { switch (status) { case 0: - case -ETIMEDOUT: + case -ETIME: case -EOVERFLOW: case -EAGAIN: case -EPIPE: diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/net/pegasus.c linux-2.6.18-rc1-lem/drivers/usb/net/pegasus.c --- linux-2.6.18-rc1/drivers/usb/net/pegasus.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/net/pegasus.c 2006-08-14 17:52:29.000000000 -0700 @@ -619,7 +619,7 @@ static void read_bulk_callback(struct ur 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 -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/net/rtl8150.c linux-2.6.18-rc1-lem/drivers/usb/net/rtl8150.c --- linux-2.6.18-rc1/drivers/usb/net/rtl8150.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/net/rtl8150.c 2006-08-14 17:53:09.000000000 -0700 @@ -428,7 +428,7 @@ static void read_bulk_callback(struct ur break; case -ENOENT: return; /* the urb is in unlink state */ - case -ETIMEDOUT: + case -ETIME: warn("may be reset is needed?.."); goto goon; default: diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/net/usbnet.c linux-2.6.18-rc1-lem/drivers/usb/net/usbnet.c --- linux-2.6.18-rc1/drivers/usb/net/usbnet.c 2006-07-09 17:54:36.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/net/usbnet.c 2006-08-14 17:54:52.000000000 -0700 @@ -413,7 +413,7 @@ static void rx_complete (struct urb *urb // 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 -ETIME: // ohci case -EILSEQ: // uhci dev->stats.rx_errors++; if (!timer_pending (&dev->delay)) { @@ -798,7 +798,7 @@ static void tx_complete (struct urb *urb // 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 -ETIME: // ohci case -EILSEQ: // uhci if (!timer_pending (&dev->delay)) { mod_timer (&dev->delay, { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \ diff -urp -X dontdiff linux-2.6.18-rc1/drivers/usb/storage/transport.c linux-2.6.18-rc1-lem/drivers/usb/storage/transport.c --- linux-2.6.18-rc1/drivers/usb/storage/transport.c 2006-07-09 17:54:37.000000000 -0700 +++ linux-2.6.18-rc1-lem/drivers/usb/storage/transport.c 2006-07-26 18:48:15.000000000 -0700 @@ -294,11 +294,6 @@ static int interpret_urb_result(struct u 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"); diff -urp -X dontdiff linux-2.6.18-rc1/sound/usb/usbmidi.c linux-2.6.18-rc1-lem/sound/usb/usbmidi.c --- linux-2.6.18-rc1/sound/usb/usbmidi.c 2006-07-09 17:55:24.000000000 -0700 +++ linux-2.6.18-rc1-lem/sound/usb/usbmidi.c 2006-08-14 18:33:55.000000000 -0700 @@ -182,7 +182,7 @@ static int snd_usbmidi_urb_error(int sta return -ENODEV; /* errors that might occur during unplugging */ case -EPROTO: /* EHCI */ - case -ETIMEDOUT: /* OHCI */ + case -ETIME: /* OHCI */ case -EILSEQ: /* UHCI */ return -EIO; default: ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel