Re: [PATCH] usb: gadget: file_storage: don't assume wMaxPacketSize to be 512

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

 



On Thu, 7 Apr 2011, Mian Yousaf Kaukab wrote:

> On Wed, Apr 6, 2011 at 5:08 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> >> AFAIK, only mass storage class sets this flag in the kernel and in
> >> mass-storage it is already a protocol error if a short-packet arrives
> >> when a maxp size packet was expected.
> >
> > Actually the spec doesn't say how to handle such situations.  The
> > mass-storage gadgets don't treat it as a protocol error.
> >
> >> If we don't use short_not_ok, then we will have to wait for each
> >> packet to arrive and then based on its size we can set dma. This is
> >> what we do if short_not_ok is set to 0.
> >
> > What's wrong with doing this always?
> 
> Performance reasons mainly. If short_not_ok is set, we can program the
> dma for the full buffer length. Otherwise we program it for each
> packet.

What happens if short_not_ok is set and you program the DMA for the
full buffer length, but a short packet arrives?

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