diff mbox

[04/32] dmaengine: edma: explicitly freeup irq

Message ID 1467730478-9696-5-git-send-email-vinod.koul@intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Vinod Koul July 5, 2016, 2:54 p.m. UTC
dmaengine device should explicitly call devm_free_irq() when using
devm_reqister_irq().

The irq is still ON when devices remove is executed and irq should be
quiesced before remove is completed.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/dma/edma.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Peter Ujfalusi July 5, 2016, 7:59 p.m. UTC | #1
On 07/05/2016 05:54 PM, Vinod Koul wrote:
> dmaengine device should explicitly call devm_free_irq() when using
> devm_reqister_irq().
> 
> The irq is still ON when devices remove is executed and irq should be
> quiesced before remove is completed.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  drivers/dma/edma.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index b95ef7482c52..dffbd4bb0d8b 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -239,6 +239,9 @@ struct edma_cc {
>  	bool				chmap_exist;
>  	enum dma_event_q		default_queue;
>  
> +	unsigned int			ccint;
> +	unsigned int			ccerrint;
> +
>  	/*
>  	 * The slot_inuse bit for each PaRAM slot is clear unless the slot is
>  	 * in use by Linux or if it is allocated to be used by DSP.
> @@ -2283,6 +2286,7 @@ static int edma_probe(struct platform_device *pdev)
>  			dev_err(dev, "CCINT (%d) failed --> %d\n", irq, ret);
>  			return ret;
>  		}
> +		ecc->ccint = irq;
>  	}
>  
>  	irq = platform_get_irq_byname(pdev, "edma3_ccerrint");
> @@ -2298,6 +2302,7 @@ static int edma_probe(struct platform_device *pdev)
>  			dev_err(dev, "CCERRINT (%d) failed --> %d\n", irq, ret);
>  			return ret;
>  		}
> +		ecc->ccerrint = irq;
>  	}
>  
>  	ecc->dummy_slot = edma_alloc_slot(ecc, EDMA_SLOT_ANY);
> @@ -2393,6 +2398,9 @@ static int edma_remove(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct edma_cc *ecc = dev_get_drvdata(dev);
>  
> +	devm_free_irq(dev, ecc->ccint, ecc);
> +	devm_free_irq(dev, ecc->ccerrint, ecc);
> +
>  	if (dev->of_node)
>  		of_dma_controller_free(dev->of_node);
>  	dma_async_device_unregister(&ecc->dma_slave);
>
diff mbox

Patch

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index b95ef7482c52..dffbd4bb0d8b 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -239,6 +239,9 @@  struct edma_cc {
 	bool				chmap_exist;
 	enum dma_event_q		default_queue;
 
+	unsigned int			ccint;
+	unsigned int			ccerrint;
+
 	/*
 	 * The slot_inuse bit for each PaRAM slot is clear unless the slot is
 	 * in use by Linux or if it is allocated to be used by DSP.
@@ -2283,6 +2286,7 @@  static int edma_probe(struct platform_device *pdev)
 			dev_err(dev, "CCINT (%d) failed --> %d\n", irq, ret);
 			return ret;
 		}
+		ecc->ccint = irq;
 	}
 
 	irq = platform_get_irq_byname(pdev, "edma3_ccerrint");
@@ -2298,6 +2302,7 @@  static int edma_probe(struct platform_device *pdev)
 			dev_err(dev, "CCERRINT (%d) failed --> %d\n", irq, ret);
 			return ret;
 		}
+		ecc->ccerrint = irq;
 	}
 
 	ecc->dummy_slot = edma_alloc_slot(ecc, EDMA_SLOT_ANY);
@@ -2393,6 +2398,9 @@  static int edma_remove(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct edma_cc *ecc = dev_get_drvdata(dev);
 
+	devm_free_irq(dev, ecc->ccint, ecc);
+	devm_free_irq(dev, ecc->ccerrint, ecc);
+
 	if (dev->of_node)
 		of_dma_controller_free(dev->of_node);
 	dma_async_device_unregister(&ecc->dma_slave);