[U-Boot] [PATCH 2/3] usb: gadget: dwc2_udc_otg: fixed the error that the last packet transmission could not be terminated
Frank Wang
frank.wang at rock-chips.com
Tue Dec 22 09:25:51 CET 2015
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 at rock-chips.com>
---
drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
1.7.9.5
More information about the U-Boot
mailing list