Skip to content

Commit

Permalink
usb: musb: gadget: don't program dma for zero byte tx
Browse files Browse the repository at this point in the history
This is to reduce the overhead of dma programming for zero byte
transmit as same can be done using pio mode.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Ajay Kumar Gupta authored and Felipe Balbi committed Aug 3, 2012
1 parent 3132122 commit d17d535
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 @@ -373,7 +373,7 @@ static void txstate(struct musb *musb, struct musb_request *req)
request_size = min_t(size_t, request->length - request->actual,
musb_ep->dma->max_len);

use_dma = (request->dma != DMA_ADDR_INVALID);
use_dma = (request->dma != DMA_ADDR_INVALID && request_size);

/* MUSB_TXCSR_P_ISO is still set correctly */

Expand Down

0 comments on commit d17d535

Please sign in to comment.