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

Commit d1043a26 authored by Anand Gadiyar's avatar Anand Gadiyar Committed by Greg Kroah-Hartman
Browse files

musb: use dma mode 1 for TX if transfer size equals maxpacket (v2)



Currently, with Inventra DMA, we use Mode 0 if transfer size is less
than or equal to the endpoint's maxpacket size.  This requires that
we explicitly set TXPKTRDY for that transfer.

However the musb_g_tx code will not set TXPKTRDY twice if the last
transfer is exactly equal to maxpacket, even if request->zero is set.
Using Mode 1 will solve this; a better fix might be in musb_g_tx().

Without this change, musb will not correctly send out a ZLP if the
last transfer is the maxpacket size and request->zero is set.

Signed-off-by: default avatarAnand Gadiyar <gadiyar@ti.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ab983f2a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
			/* setup DMA, then program endpoint CSR */
			request_size = min(request->length,
						musb_ep->dma->max_len);
			if (request_size <= musb_ep->packet_sz)
			if (request_size < musb_ep->packet_sz)
				musb_ep->dma->desired_mode = 0;
			else
				musb_ep->dma->desired_mode = 1;