Re: BULK_CONTINUATION and bulk out transfers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 21 Apr 2010, Daniel Drake wrote:

> El 21/04/10 10:51, Alan Stern escribió:
> >> El 01/09/09 12:09, Alan Stern escribió:
> >>> In the updated patch this mechanism affects all bulk transfers, not
> >>> just bulk-IN.  So for example, if a transient hardware problem causes a
> >>> bulk-OUT URB to fail, the remaining URBs in that transfer will
> >>> automatically be cancelled.
> >>>
> >>> I will post the new patch shortly.  The expectation is that it will get
> >>> into the next merge window, so it will appear in 2.6.32.
> >>
> >> Digging up an old topic...
> >> http://www.libusb.org/ticket/20 points out that OUT urbs with
> >> SHORT_NOT_OK set generate warnings and rejects transfers in debug mode.
> >
> > Right.  URB_SHORT_NOT_OK makes sense only for IN transfers.
> 
> That seems to be in conflict to what you said in the quote further above 
> (01/09/09). Or am I not understanding?

I guess you don't understand.  :-)

The point you're probably missing is that if a bulk-OUT transfer
encounters an error, it will fail (and the remaining URBs in the
transfer will be cancelled) even though URB_SHORT_NOT_OK isn't set.

An URB can encounter an error for several possible reasons.  The 
most common, of course, is that the target device was unplugged, but 
there are others.

IN URBs will complete early if a short packet is received.  In many
cases this is normal and expected, not an error.  The purpose of the
URB_SHORT_NOT_OK flag is to tell the USB stack that a short packet
_should_ be considered an error; otherwise it won't be.

So what I said originally still stands.  If a bulk URB completes with 
an error (whether because the device was unplugged or because a short 
packet was received and URB_SHORT_NOT_OK was set), the remaining URBs 
in the same transfer will be cancelled.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux