]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
dwc2: gadget: Fix completed transfer size calculation in DDMA
authorMinas Harutyunyan <minas.harutyunyan@synopsys.com>
Fri, 22 Feb 2019 11:49:19 +0000 (15:49 +0400)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 5acb4b970184d189d901192d075997c933b82260 ]

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>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/dwc2/gadget.c

index 5aa7b30616dd40e3da41b6ddcf730c2ea69c7018..ce9df56b3474bef534c43fa9994504b7c2bdbd17 100644 (file)
@@ -2235,6 +2235,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;