[PATCH 02/11] dmaengine: dw-axi-dmac: remove unnecessary devm_free_irq() calling

Jisheng Zhang posted 11 patches 2 years, 11 months ago
There is a newer version of this series
[PATCH 02/11] dmaengine: dw-axi-dmac: remove unnecessary devm_free_irq() calling
Posted by Jisheng Zhang 2 years, 11 months ago
In dw_remove(), We have disabled the irq from the dw-axi-dma side, so
we are safe against the case "The irq is still ON when devices remove
is executed and irq should be quiesced before remove is completed."

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 23a10dbdecb7..56f12dfa410d 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1542,8 +1542,6 @@ static int dw_remove(struct platform_device *pdev)
 	pm_runtime_disable(chip->dev);
 	axi_dma_suspend(chip);
 
-	devm_free_irq(chip->dev, chip->irq, chip);
-
 	of_dma_controller_free(chip->dev->of_node);
 
 	list_for_each_entry_safe(chan, _chan, &dw->dma.channels,
-- 
2.39.2
Re: [PATCH 02/11] dmaengine: dw-axi-dmac: remove unnecessary devm_free_irq() calling
Posted by Vinod Koul 2 years, 10 months ago
On 14-03-23, 01:04, Jisheng Zhang wrote:
> In dw_remove(), We have disabled the irq from the dw-axi-dma side, so
> we are safe against the case "The irq is still ON when devices remove
> is executed and irq should be quiesced before remove is completed."

what about the interrupts which might fire spuriously after this? I
prefer to keep this explicitly here
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> index 23a10dbdecb7..56f12dfa410d 100644
> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> @@ -1542,8 +1542,6 @@ static int dw_remove(struct platform_device *pdev)
>  	pm_runtime_disable(chip->dev);
>  	axi_dma_suspend(chip);
>  
> -	devm_free_irq(chip->dev, chip->irq, chip);
> -
>  	of_dma_controller_free(chip->dev->of_node);
>  
>  	list_for_each_entry_safe(chan, _chan, &dw->dma.channels,
> -- 
> 2.39.2

-- 
~Vinod
Re: [PATCH 02/11] dmaengine: dw-axi-dmac: remove unnecessary devm_free_irq() calling
Posted by Jisheng Zhang 2 years, 10 months ago
On Wed, Apr 12, 2023 at 11:08:16PM +0530, Vinod Koul wrote:
> On 14-03-23, 01:04, Jisheng Zhang wrote:
> > In dw_remove(), We have disabled the irq from the dw-axi-dma side, so
> > we are safe against the case "The irq is still ON when devices remove
> > is executed and irq should be quiesced before remove is completed."
> 
> what about the interrupts which might fire spuriously after this? I

This is impossible becuase the irq has been disabled from the dw-axi-dma
side.

> prefer to keep this explicitly here
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> >  drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > index 23a10dbdecb7..56f12dfa410d 100644
> > --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > @@ -1542,8 +1542,6 @@ static int dw_remove(struct platform_device *pdev)
> >  	pm_runtime_disable(chip->dev);
> >  	axi_dma_suspend(chip);
> >  
> > -	devm_free_irq(chip->dev, chip->irq, chip);
> > -
> >  	of_dma_controller_free(chip->dev->of_node);
> >  
> >  	list_for_each_entry_safe(chan, _chan, &dw->dma.channels,
> > -- 
> > 2.39.2
> 
> -- 
> ~Vinod