Commit d9261898 authored by John Youn's avatar John Youn Committed by Felipe Balbi

usb: dwc3: gadget: don't send extra ZLP

If the request->length is zero, a ZLP should already be sent due to that
and another ZLP is not needed to terminate the transfer.

Fixes: 04c03d10 ("usb: dwc3: gadget: handle request->zero")
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 746bfe63
...@@ -1203,7 +1203,8 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request, ...@@ -1203,7 +1203,8 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
* extra usb_request ourselves so that it gets handled the same way as * extra usb_request ourselves so that it gets handled the same way as
* any other request. * any other request.
*/ */
if (ret == 0 && request->zero && (request->length % ep->maxpacket == 0)) if (ret == 0 && request->zero && request->length &&
(request->length % ep->maxpacket == 0))
ret = __dwc3_gadget_ep_queue_zlp(dwc, dep); ret = __dwc3_gadget_ep_queue_zlp(dwc, dep);
spin_unlock_irqrestore(&dwc->lock, flags); spin_unlock_irqrestore(&dwc->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment