Re: [PATCH 1/2] dmaengine: at_xdmac: Remove unnecessary synchronize_irq() before free_irq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 21, 2015 at 12:09:47PM +0100, Lars-Peter Clausen wrote:
> Calling synchronize_irq() right before free_irq() is quite useless. On one
> hand the IRQ can easily fire again before free_irq() is entered, on the
> other hand free_irq() itself calls synchronize_irq() internally (in a race
> condition free way), before any state associated with the IRQ is freed.
> 
> Patch was generated using the following semantic patch:
> // <smpl>
> @@
> expression irq;
> @@
> -synchronize_irq(irq);
>  free_irq(irq, ...);
> // </smpl>
> 
> Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>

It sounds good.
Acked-by: Ludovic Desroches <ludovic.desroches@xxxxxxxxx>

> ---
>  drivers/dma/at_xdmac.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index 7f039de..d02276f 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -1995,8 +1995,6 @@ static int at_xdmac_remove(struct platform_device *pdev)
>  	dma_async_device_unregister(&atxdmac->dma);
>  	clk_disable_unprepare(atxdmac->clk);
>  
> -	synchronize_irq(atxdmac->irq);
> -
>  	free_irq(atxdmac->irq, atxdmac->dma.dev);
>  
>  	for (i = 0; i < atxdmac->dma.chancnt; i++) {
> -- 
> 2.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux