Skip to content

Commit

Permalink
usb: musb: host: release dma channels if no active io
Browse files Browse the repository at this point in the history
Currently DMA channels are allocated and they remain allocated
even if there is no active data transfer. Added channel_release()
whenever there is no pending request.

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 Jun 22, 2012
1 parent d7dbdb5 commit 8c778db
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/usb/musb/musb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,21 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb,
*/
if (list_empty(&qh->hep->urb_list)) {
struct list_head *head;
struct dma_controller *dma = musb->dma_controller;

if (is_in)
if (is_in) {
ep->rx_reinit = 1;
else
if (ep->rx_channel) {
dma->channel_release(ep->rx_channel);
ep->rx_channel = NULL;
}
} else {
ep->tx_reinit = 1;
if (ep->tx_channel) {
dma->channel_release(ep->tx_channel);
ep->tx_channel = NULL;
}
}

/* Clobber old pointers to this qh */
musb_ep_set_qh(ep, is_in, NULL);
Expand Down

0 comments on commit 8c778db

Please sign in to comment.