Re: [linux-usb-devel] [PATCH 2/2] usbatm: Detect usb device shutdownand ignore failed urbs.

From: Alan Stern
Date: Fri Feb 23 2007 - 13:12:27 EST

On Fri, 23 Feb 2007, Duncan Sands wrote:

> Thanks Alan. The original question was: if an urb fails with an error,
> is there any point in resubmitting it after a delay (which is what the
> driver usually does) if the error was -ESHUTDOWN? It sounds like there
> is no point to it.

No, there isn't.

> And if the device is not disconnected, then it could
> even be harmful since the urb will be resubmitted endlessly... While on
> the topic, are there any other error codes for which an urb should not be
> resubmitted?

Let's see... ENOENT and ECONNRESET indicate the URB was unlinked, so you
probably don't want to resubmit it. EPIPE indicates a problem on the
device end, so you would want to fix the problem before resubmitting (at
the very least you would want to clear the halt). EOVERFLOW is
questionable; if the device sent too much data once then it might do so
again. Ditto for EREMOTEIO (the device sent too little data). ENODEV
means the device was removed, so you definitely don't want to resubmit.

Alan Stern

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at