diff mbox series

dwc2: gadget: Fix completed transfer size calculation in DDMA

Message ID 75e9fad75baf518f5b6df18c6b28c8744abed183.1550822090.git.hminas@synopsys.com (mailing list archive)
State Mainlined
Commit 5acb4b970184d189d901192d075997c933b82260
Headers show
Series dwc2: gadget: Fix completed transfer size calculation in DDMA | expand

Commit Message

Minas Harutyunyan Feb. 22, 2019, 11:49 a.m. UTC
Fix calculation of transfer size on completion in function
dwc2_gadget_get_xfersize_ddma().

Added increment of descriptor pointer to move to next descriptor in
the loop.

Fixes: aa3e8bc81311 ("usb: dwc2: gadget: DDMA transfer start and complete")

Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
---
 drivers/usb/dwc2/gadget.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 6812a8a3a98b..6cf1eaaf4456 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2311,6 +2311,7 @@  static unsigned int dwc2_gadget_get_xfersize_ddma(struct dwc2_hsotg_ep *hs_ep)
 		if (status & DEV_DMA_STS_MASK)
 			dev_err(hsotg->dev, "descriptor %d closed with %x\n",
 				i, status & DEV_DMA_STS_MASK);
+		desc++;
 	}
 
 	return bytes_rem;