diff options
author | Ajay Kumar Gupta <ajay.gupta@ti.com> | 2012-06-21 07:48:12 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-06-22 06:15:55 -0400 |
commit | 8c778db9f01a1b6c785890b5fd83c7addfd3eb3a (patch) | |
tree | 3a03a527f30759f951cb6887e1dbcbe1e9d6446e /drivers/usb/musb | |
parent | d7dbdb5e5fe809aa3d4c33b33943c94321dfdd06 (diff) |
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: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_host.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index ef8d744800ac..e090c799d87b 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -375,11 +375,21 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb, | |||
375 | */ | 375 | */ |
376 | if (list_empty(&qh->hep->urb_list)) { | 376 | if (list_empty(&qh->hep->urb_list)) { |
377 | struct list_head *head; | 377 | struct list_head *head; |
378 | struct dma_controller *dma = musb->dma_controller; | ||
378 | 379 | ||
379 | if (is_in) | 380 | if (is_in) { |
380 | ep->rx_reinit = 1; | 381 | ep->rx_reinit = 1; |
381 | else | 382 | if (ep->rx_channel) { |
383 | dma->channel_release(ep->rx_channel); | ||
384 | ep->rx_channel = NULL; | ||
385 | } | ||
386 | } else { | ||
382 | ep->tx_reinit = 1; | 387 | ep->tx_reinit = 1; |
388 | if (ep->tx_channel) { | ||
389 | dma->channel_release(ep->tx_channel); | ||
390 | ep->tx_channel = NULL; | ||
391 | } | ||
392 | } | ||
383 | 393 | ||
384 | /* Clobber old pointers to this qh */ | 394 | /* Clobber old pointers to this qh */ |
385 | musb_ep_set_qh(ep, is_in, NULL); | 395 | musb_ep_set_qh(ep, is_in, NULL); |