Commit 8c778db9 authored by Ajay Kumar Gupta's avatar Ajay Kumar Gupta Committed by Felipe Balbi

usb: musb: host: release dma channels if no active io

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: default avatarAjay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d7dbdb5e
...@@ -375,11 +375,21 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb, ...@@ -375,11 +375,21 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb,
*/ */
if (list_empty(&qh->hep->urb_list)) { if (list_empty(&qh->hep->urb_list)) {
struct list_head *head; struct list_head *head;
struct dma_controller *dma = musb->dma_controller;
if (is_in) if (is_in) {
ep->rx_reinit = 1; ep->rx_reinit = 1;
else if (ep->rx_channel) {
dma->channel_release(ep->rx_channel);
ep->rx_channel = NULL;
}
} else {
ep->tx_reinit = 1; ep->tx_reinit = 1;
if (ep->tx_channel) {
dma->channel_release(ep->tx_channel);
ep->tx_channel = NULL;
}
}
/* Clobber old pointers to this qh */ /* Clobber old pointers to this qh */
musb_ep_set_qh(ep, is_in, NULL); musb_ep_set_qh(ep, is_in, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment