Message ID | 1450772752-99784-3-git-send-email-frank.wang@rock-chips.com |
---|---|
State | Deferred |
Delegated to: | Ćukasz Majewski |
Headers | show |
diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c index bce9c30..ce4d44d 100644 --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c @@ -237,7 +237,7 @@ static void complete_rx(struct dwc2_udc *dev, u8 ep_num) __func__, ep_num, req->req.actual, req->req.length, is_short, ep_tsr, xfer_size); - if (is_short || req->req.actual == req->req.length) { + if (is_short || req->req.actual <= req->req.length) { if (ep_num == EP0_CON && dev->ep0state == DATA_STATE_RECV) { debug_cond(DEBUG_OUT_EP != 0, " => Send ZLP\n"); dwc2_udc_ep0_zlp(dev);
When the actual length is less than request length in the last request, the data transmission should be terminated, because the packet transmission have alreay finished. Signed-off-by: Frank Wang <frank.wang@rock-chips.com> --- drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)