提交 3132122c 编写于 作者: A Ajay Kumar Gupta 提交者: Felipe Balbi

usb: musb: host: don't program dma for zero byte tx

This is to reduce the overhead of dma programming for zero byte
transmit as same can be done using pio mode.
Signed-off-by: NAjay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 f0443afd
...@@ -693,6 +693,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -693,6 +693,8 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
void __iomem *epio = hw_ep->regs; void __iomem *epio = hw_ep->regs;
struct musb_qh *qh = musb_ep_get_qh(hw_ep, !is_out); struct musb_qh *qh = musb_ep_get_qh(hw_ep, !is_out);
u16 packet_sz = qh->maxpacket; u16 packet_sz = qh->maxpacket;
u8 use_dma = 1;
u16 csr;
dev_dbg(musb->controller, "%s hw%d urb %p spd%d dev%d ep%d%s " dev_dbg(musb->controller, "%s hw%d urb %p spd%d dev%d ep%d%s "
"h_addr%02x h_port%02x bytes %d\n", "h_addr%02x h_port%02x bytes %d\n",
...@@ -704,9 +706,17 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -704,9 +706,17 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
musb_ep_select(mbase, epnum); musb_ep_select(mbase, epnum);
if (is_out && !len) {
use_dma = 0;
csr = musb_readw(epio, MUSB_TXCSR);
csr &= ~MUSB_TXCSR_DMAENAB;
musb_writew(epio, MUSB_TXCSR, csr);
hw_ep->tx_channel = NULL;
}
/* candidate for DMA? */ /* candidate for DMA? */
dma_controller = musb->dma_controller; dma_controller = musb->dma_controller;
if (is_dma_capable() && epnum && dma_controller) { if (use_dma && is_dma_capable() && epnum && dma_controller) {
dma_channel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel; dma_channel = is_out ? hw_ep->tx_channel : hw_ep->rx_channel;
if (!dma_channel) { if (!dma_channel) {
dma_channel = dma_controller->channel_alloc( dma_channel = dma_controller->channel_alloc(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册