Re: [PATCH] usb/uas: make sure data urb is gone if we receive status before that

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

 



On Thu, 26 Jan 2012, Sebastian Andrzej Siewior wrote:

> >>> You should not depend on this.  However, the uas driver should not
> >>> consider an unlinked data URB to indicate an error -- even if
> >>> actual_length is 0.
> >>
> >> The UAS driver sets the scsi status to whatever the device set it in
> >> its status/sense reply. So you might receive no error and no data
> >> according to the race mentioned by Sarah.
> >
> > Why would you receive no data?  All the data sent by the device should
> > be received and stored in the host's buffers by the time the status is
> > received, even if the status URB completes before the data URB.
> 
> Because the XHCI core re-ordered the data and status URB and status
> completed before data. So the data urb got canceled.

That doesn't mean you received no data.  No data means
urb->actual_length == 0, whereas cancelled means urb->status == -ENOENT
or -ECONNRESET.  Those are two independent conditions; one can be true
without the other.

That's what would happen in this case.  Since all the data was received 
by the host, urb->actual_length would be nonzero -- even if urb->status 
indicates an unlink.

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