mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
fotg210-udc: Fix DMA on EP0 for length > max packet size
[ Upstream commit 755915fc28edfc608fa89a163014acb2f31c1e19 ]
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: b84a8dee23 ("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>
This commit is contained in:
parent
05ec8192ee
commit
9a97aa4bbe
1 changed files with 1 additions and 1 deletions
|
|
@ -346,7 +346,7 @@ static void fotg210_start_dma(struct fotg210_ep *ep,
|
|||
if (req->req.length - req->req.actual > ep->ep.maxpacket)
|
||||
length = ep->ep.maxpacket;
|
||||
else
|
||||
length = req->req.length;
|
||||
length = req->req.length - req->req.actual;
|
||||
}
|
||||
|
||||
d = dma_map_single(dev, buffer, length,
|
||||
|
|
|
|||
Loading…
Reference in a new issue