summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAjay Kumar Gupta <ajay.gupta@ti.com>2012-06-21 17:18:12 +0530
committerFelipe Balbi <balbi@ti.com>2012-06-22 13:15:55 +0300
commit8c778db9f01a1b6c785890b5fd83c7addfd3eb3a (patch)
tree3a03a527f30759f951cb6887e1dbcbe1e9d6446e /drivers/usb
parentd7dbdb5e5fe809aa3d4c33b33943c94321dfdd06 (diff)
downloadop-kernel-dev-8c778db9f01a1b6c785890b5fd83c7addfd3eb3a.zip
op-kernel-dev-8c778db9f01a1b6c785890b5fd83c7addfd3eb3a.tar.gz
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')
-rw-r--r--drivers/usb/musb/musb_host.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index ef8d744..e090c79 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,
*/
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);
OpenPOWER on IntegriCloud