Skip to content

Commit

Permalink
musb: use dma mode 1 for TX if transfer size equals maxpacket (v2)
Browse files Browse the repository at this point in the history
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: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Anand Gadiyar authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent ab983f2 commit d1043a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/musb/musb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1043a2

Please sign in to comment.