Hi,

On Wed, Dec 18, 2013 at 03:22:07PM +0530, Pratyush Anand wrote:
> > > In accordance with specification, when sent data length is
> > 
> > please mention section of specification.
> > 
> > > 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.
> 
> Curious, what was the use case when you encountered above situation?
> 
> Wouldn't something simple as follows be able to resolve it?
> 
> diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
> index 95f7649..8b419aa 100644
> --- a/drivers/usb/dwc3/ep0.c
> +++ b/drivers/usb/dwc3/ep0.c
> @@ -924,6 +924,10 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
>  
>               ret = dwc3_ep0_start_trans(dwc, dep->number, req->request.dma,
>                               req->request.length, DWC3_TRBCTL_CONTROL_DATA);
> +             if (req->zero && !ret)
> +                     ret = dwc3_ep0_start_trans(dwc, dep->number,
> +                                     dwc->ctrl_req_addr, 0,
> +                                     DWC3_TRBCTL_CONTROL_DATA);

at this time you don't know if the previous transfer has completed ;-)
But true, a use-case scenario would be great.

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to