Re: [v4] usb: UHCI: fix pkt size in TD for a sg element

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

 



On Mon, 24 Jun 2013, Sebastian Andrzej Siewior wrote:

> On 06/24/2013 05:04 PM, Felipe Balbi wrote:
> >> - the change violates USB spec(1.1/2.0/3.0)
> > 
> > I can't see how this would violate USB spec. USB specifications
> > have no knowledge of scatter-gather.
> > 
> > It really doesn't matter how the data gets into the HW's FIFO, as
> > long as it *does* get there. IOW an SG table like below:
> > 
> > sg[0].length = 512 sg[1].length = 512 sg[2].length = 20
> > 
> > is no different than:
> > 
> > sg[0].length = 502 sg[1].length = 512 sg[2].length = 30
> > 
> > from the USB perspective, all is sees is 1044 bytes being shifted 
> > through the data lines.
> 
> It is a little. The first USB packet has 512 vs 502 bytes on the wire.
> Depending on the protocol on the wire it is an issue.

The USB spec states that every packet except the last one in a bulk 
transfer must be of maximum size.  The second sequence above violates 
this requirement.  So it is always an issue.

> But this is almost kidergarder. We have only mass storage using this
> which does not do this. You can't even merge sgs at that level so that
> you run in such a problem. So this is simply a tool used wrong.
> I agree with the patch Alan acked.

Well, even now usbtest uses SG transfers.  (That was the motivation for 
the patch in the first place.)  Other drivers may use it in the future.

I agree with Ming Lei that it is best to return an error when these 
incorrect transfer requests are submitted, rather than send packets 
with incorrect lengths.

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