Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1860237 authored by Fabian Vogt's avatar Fabian Vogt Committed by Greg Kroah-Hartman
Browse files

fotg210-udc: Complete OUT requests on short packets



[ Upstream commit 75bb93be0027123b5db6cbcce89eb62f0f6b3c5b ]

A short packet indicates the end of a transfer and marks the request as
complete.

Fixes: b84a8dee ("usb: gadget: add Faraday fotg210_udc driver")
Signed-off-by: default avatarFabian Vogt <fabian@ritter-vogt.de>
Link: https://lore.kernel.org/r/20210324141115.9384-8-fabian@ritter-vogt.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 183b6757
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -853,12 +853,16 @@ static void fotg210_out_fifo_handler(struct fotg210_ep *ep)
{
	struct fotg210_request *req = list_entry(ep->queue.next,
						 struct fotg210_request, queue);
	int disgr1 = ioread32(ep->fotg210->reg + FOTG210_DISGR1);

	fotg210_start_dma(ep, req);

	/* finish out transfer */
	/* Complete the request when it's full or a short packet arrived.
	 * Like other drivers, short_not_ok isn't handled.
	 */

	if (req->req.length == req->req.actual ||
	    req->req.actual < ep->ep.maxpacket)
	    (disgr1 & DISGR1_SPK_INT(ep->epnum - 1)))
		fotg210_done(ep, req, 0);
}