Re: [PATCH] usb: dwc3: ep0: Handle variable-length Data Stage

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

 



On Thu, Dec 19, 2013 at 07:03:48AM +0000, Paul Zimmerman wrote:
> > From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Felipe Balbi
> > Sent: Wednesday, December 18, 2013 10:03 PM
> > 
> > On Thu, Dec 19, 2013 at 11:32:08AM +0900, Anton Tikhomirov wrote:
> > > Hi,
> > >
> > > > Hi,
> > > >
> > > > On Tue, Dec 17, 2013 at 03:59:31PM +0900, Anton Tikhomirov wrote:
> > > > > In accordance with specification, when sent data length is
> > > >
> > > > please mention section of specification.
> > >
> > > USB2.0 spec., 8.5.3.2 Variable-length Data Stage
> > >
> > > >
> > > > > an exact multiple of wMaxPacketSize for the pipe and less
> > > > > than requested by host, the function shall return a zero-length
> > > > > packet (ZLP) to indicate the end of the Data stage to a USB host.
> > > >
> > > > hmm... so in USB3 mode that would be host requesting 513 bytes and us
> > > > sending only 512.
> > >
> > > Our customer reported this issue. In their case, Windows USB2.0 host
> > > requests Configuration descriptor with wLength = 255. Device replies
> > > with two 64 bytes IN transactions, and stalls EP0 on 3rd IN transaction,
> > > where it has to reply with ZLP. Unfortunately, we don’t have full
> > > picture of what's happening on their side and why host requests
> > > more bytes than actual length of Configuration descriptor.
> > 
> > that's a bug on the host side.
> 
> Certainly not. The host doesn't know how big the Configuration descriptor
> is, so it always asks for 255 bytes (on Windows that is, I'm not sure
> about Linux).

yeah, that's true. Linux requests for 18 bytes (IIRC) then after that it
reads wTotalLength to figure out how to request as a follow up, but the
same issue could happen.

> The problem here sounds like the Configuration descriptor for this
> particular device is exactly 128 bytes (two packets at HS), so a 0-length
> packet is needed to terminate the transfer.

true

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux