Hi,
in my usblib application I poll a bulk endpoint with a timeout of 1000(ms),
This ends up calling usb_start_wait_urb in drivers/usb/core/message.c
which checks for ECONNRESET (and changes the return code to
ETIMEDOUT) but sometimes (quite often) there is data in the urb even when
ECONNRESET is returned which is then discarded because of the error code.
A naive fix is to replace the check with this code


               if (status == -ECONNRESET) {
                       dev_warn(&urb->dev->dev,
                               "%s timed out on ep%d%s len %d\n",
                               current->comm,
                               usb_pipeendpoint(urb->pipe),
                               usb_pipein(urb->pipe) ? "in" : "out",
                               urb->actual_length);
                       if (urb->actual_length == 0)
                           status = -ETIMEDOUT;
                       else
                           status = 0;
               }

which changes an urb which gets an ECONNRESET to a sucessful one if it contains
data. Perhaps the correct fix is to not set ECONNRESET in the first place when there
is data in the urb?


/Brian


------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to