fotg210-udc: Fix DMA on EP0 for length > max packet size
authorFabian Vogt <fabian@ritter-vogt.de>
Wed, 24 Mar 2021 14:11:09 +0000 (15:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:40:23 +0000 (10:40 +0200)
commitc507ca91fb7496c83a834773d773989cb6350df4
tree927b13a1dd4f5b0f8659cb9b70de2bf8476e89dd
parentf4c4e07140687f42bfa40e091bb4a55d7960ce4d
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: b84a8dee23fd ("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>
drivers/usb/gadget/udc/fotg210-udc.c