Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 84d38ee

Browse files
Vogtinatorgregkh
authored andcommitted
fotg210-udc: Fix DMA on EP0 for length > max packet size
[ Upstream commit 755915f ] For a 75 Byte request, it would send the first 64 separately, then detect that the remaining 11 Byte fit into a single DMA, but due to this bug set the length to the original 75 Bytes. This leads to a DMA failure (which is ignored...) and the request completes without the remaining bytes having been sent. Fixes: b84a8de ("usb: gadget: add Faraday fotg210_udc driver") Signed-off-by: Fabian Vogt <fabian@ritter-vogt.de> Link: https://lore.kernel.org/r/20210324141115.9384-2-fabian@ritter-vogt.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1ea500c commit 84d38ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/gadget/udc/fotg210-udc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ static void fotg210_start_dma(struct fotg210_ep *ep,
346346
if (req->req.length - req->req.actual > ep->ep.maxpacket)
347347
length = ep->ep.maxpacket;
348348
else
349-
length = req->req.length;
349+
length = req->req.length - req->req.actual;
350350
}
351351

352352
d = dma_map_single(dev, buffer, length,

0 commit comments

Comments
 (0)