[PATCH v4 3/6] dmaengine: zynqmp_dma: Guard IRQ handler against spurious interrupts

Frank Li Frank.li at oss.nxp.com
Fri Oct 9 19:59:24 PDT 2026


On Fri, Oct 09, 2026 at 09:30:12AM +0530, Golla Nagendra wrote:
> Use the PM_RUNTIME_ACQUIRE_IF_ACTIVE() guard in
> zynqmp_dma_irq_handler() to safely handle spurious interrupts that may
> arrive while the device is runtime-suspended.
>
> The guard acquires a runtime PM reference only if the device is active,
> returning IRQ_NONE when the device is genuinely runtime-suspended. When
> runtime PM is disabled for the device (probe fallback path), the handler
> falls through to normal processing since the hardware is still powered.
> The reference is released automatically on function exit via the cleanup
> infrastructure.
>
> Fixes: 64c6f7da8c2c ("dmaengine: zynqmp_dma: Add runtime pm support")
> Signed-off-by: Golla Nagendra <nagendra.golla at amd.com>
> ---

Reviewed-by: Frank Li <Frank.Li at nxp.com>

>  drivers/dma/xilinx/zynqmp_dma.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
> index a48106e404e7..b5a5e93e42d5 100644
> --- a/drivers/dma/xilinx/zynqmp_dma.c
> +++ b/drivers/dma/xilinx/zynqmp_dma.c
> @@ -738,6 +738,10 @@ static irqreturn_t zynqmp_dma_irq_handler(int irq, void *data)
>  	u32 isr, imr, status;
>  	irqreturn_t ret = IRQ_NONE;
>
> +	PM_RUNTIME_ACQUIRE_IF_ACTIVE(chan->dev, pm);
> +	if (PM_RUNTIME_ACQUIRE_ERR(&pm))
> +		return IRQ_NONE;
> +
>  	isr = readl(chan->regs + ZYNQMP_DMA_ISR);
>  	imr = readl(chan->regs + ZYNQMP_DMA_IMR);
>  	status = isr & ~imr;
>
> --
> 2.43.7
>



More information about the linux-arm-kernel mailing list