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

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

 



Hi Anton,

On Wed, Dec 18, 2013 at 12:11:33PM +0800, Felipe Balbi wrote:
> 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.
> 
> > 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);
 	}
 
 	WARN_ON(ret < 0);

Regards
Pratyush
--
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