On 02.03.2015 16:58, Aleksander Morgado wrote: > When a control transfer has a short data stage, the xHCI controller generates > two transfer events: a COMP_SHORT_TX event that specifies the untransferred > amount, and a COMP_SUCCESS event. But when the data stage is not short, only the > COMP_SUCCESS event occurs. Therefore, xhci-hcd must set urb->actual_length to > urb->transfer_buffer_length while processing the COMP_SUCCESS event, unless > urb->actual_length was set already by a previous COMP_SHORT_TX event. > > The driver checks this by seeing whether urb->actual_length == 0, but this alone > is the wrong test, as it is entirely possible for a short transfer to have an > urb->actual_length = 0. > > This patch changes the xhci driver to rely on a new td->urb_length_set flag, > which is set to true when a COMP_SHORT_TX event is received and the URB length > updated at that stage. > > This fixes a bug which affected the HSO plugin, which relies on URBs with > urb->actual_length == 0 to halt re-submitting the RX URB in the control > endpoint. > > Signed-off-by: Aleksander Morgado <aleksander@xxxxxxxxxxxxx> > --- > > Hey Mathias, > > This v5 of the patch takes into account the possibility of needing to return > -EREMOTEIO if URB_SHORT_NOT_OK was requested in the transfer flags. > > With this change we no longer check for having a value in urb->actual_length, > instead we just use the new flag and therefore we treat in the same way all > cases where we got a SHORT_TX event (including those were the transfer was 0). > > Also changed the length of the comment lines to avoid going off 80chars per > line. > > Let me know what you think. > > Looks good, thanks I'll add it to my queue -Mathias -- 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