瀏覽代碼

usb: renesas_usbhs: fifo: request DMAEngine once

DMAEngine uses IRQ if dma_request_channel() was called,
and it is using devm_request_irq() today,
OTOH, dma_request_channel() will be called when each
USB connection happened on this driver.
This means same IRQ will be requested many times
whenever each USB connected,
and this IRQ isn't freed when USB disconnected.
Request DMAEngine once.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Kuninori Morimoto 11 年之前
父節點
當前提交
1b2e21b082
共有 1 個文件被更改,包括 4 次插入14 次删除
  1. 4 14
      drivers/usb/renesas_usbhs/fifo.c

+ 4 - 14
drivers/usb/renesas_usbhs/fifo.c

@@ -1124,19 +1124,8 @@ void usbhs_fifo_init(struct usbhs_priv *priv)
 	mod->irq_brdysts	= 0;
 	mod->irq_brdysts	= 0;
 
 
 	cfifo->pipe	= NULL;
 	cfifo->pipe	= NULL;
-	cfifo->tx_chan	= NULL;
-	cfifo->rx_chan	= NULL;
-
 	d0fifo->pipe	= NULL;
 	d0fifo->pipe	= NULL;
-	d0fifo->tx_chan	= NULL;
-	d0fifo->rx_chan	= NULL;
-
 	d1fifo->pipe	= NULL;
 	d1fifo->pipe	= NULL;
-	d1fifo->tx_chan	= NULL;
-	d1fifo->rx_chan	= NULL;
-
-	usbhsf_dma_init(priv, usbhsf_get_d0fifo(priv));
-	usbhsf_dma_init(priv, usbhsf_get_d1fifo(priv));
 }
 }
 
 
 void usbhs_fifo_quit(struct usbhs_priv *priv)
 void usbhs_fifo_quit(struct usbhs_priv *priv)
@@ -1147,9 +1136,6 @@ void usbhs_fifo_quit(struct usbhs_priv *priv)
 	mod->irq_ready		= NULL;
 	mod->irq_ready		= NULL;
 	mod->irq_bempsts	= 0;
 	mod->irq_bempsts	= 0;
 	mod->irq_brdysts	= 0;
 	mod->irq_brdysts	= 0;
-
-	usbhsf_dma_quit(priv, usbhsf_get_d0fifo(priv));
-	usbhsf_dma_quit(priv, usbhsf_get_d1fifo(priv));
 }
 }
 
 
 int usbhs_fifo_probe(struct usbhs_priv *priv)
 int usbhs_fifo_probe(struct usbhs_priv *priv)
@@ -1171,6 +1157,7 @@ int usbhs_fifo_probe(struct usbhs_priv *priv)
 	fifo->ctr	= D0FIFOCTR;
 	fifo->ctr	= D0FIFOCTR;
 	fifo->tx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d0_tx_id);
 	fifo->tx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d0_tx_id);
 	fifo->rx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d0_rx_id);
 	fifo->rx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d0_rx_id);
+	usbhsf_dma_init(priv, fifo);
 
 
 	/* D1FIFO */
 	/* D1FIFO */
 	fifo = usbhsf_get_d1fifo(priv);
 	fifo = usbhsf_get_d1fifo(priv);
@@ -1180,10 +1167,13 @@ int usbhs_fifo_probe(struct usbhs_priv *priv)
 	fifo->ctr	= D1FIFOCTR;
 	fifo->ctr	= D1FIFOCTR;
 	fifo->tx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d1_tx_id);
 	fifo->tx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d1_tx_id);
 	fifo->rx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d1_rx_id);
 	fifo->rx_slave.shdma_slave.slave_id	= usbhs_get_dparam(priv, d1_rx_id);
+	usbhsf_dma_init(priv, fifo);
 
 
 	return 0;
 	return 0;
 }
 }
 
 
 void usbhs_fifo_remove(struct usbhs_priv *priv)
 void usbhs_fifo_remove(struct usbhs_priv *priv)
 {
 {
+	usbhsf_dma_quit(priv, usbhsf_get_d0fifo(priv));
+	usbhsf_dma_quit(priv, usbhsf_get_d1fifo(priv));
 }
 }