On Tue, 25 Jul 2006 17:11:56 -0400 (EDT), Alan Stern <[EMAIL PROTECTED]> wrote:

> > +           /*
> > +            * A timeout could have happened becasue we reloaded and
> > +            * inherited a nonzero toggle. And there is no way to know!
> > +            * We clear and hope for the best. Bugs 129165, 160308.
> > +            */
> > +           US_DEBUGP("clearing after halt for pipe 0x%x\n", pipe);
> > +           usb_stor_clear_halt(us, pipe);
> >             return USB_STOR_XFER_ERROR;

> Isn't it true that whenever this error occurs, usb-storage will do a port 
> reset?  And won't that fix up the toggles for you?

OK, never mind. This seems not to happen anymore. Maybe something we
do now (in 2.6.18-rc1) resets toggles as a side effect... With that
out of the picture, the attached patch drops that case from the switch.

-- 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/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-25 
12:48:12.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,
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-07-25 
12:57:51.000000000 -0700
@@ -1023,6 +1023,7 @@ static void hid_irq_in(struct urb *urb, 
                        return;
                case -EILSEQ:           /* protocol error or unplug */
                case -EPROTO:           /* protocol error or unplug */
+               case -ETIME:            /* protocol error or unplug */
                case -ETIMEDOUT:        /* NAK */
                        clear_bit(HID_IN_RUNNING, &hid->iofl);
                        hid_io_error(hid);
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");

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to