[PATCH V3 3/6] dmaengine: zynqmp_dma: Guard IRQ handler against spurious interrupts
From: Golla Nagendra
Date: Mon Aug 10 2026 - 06:12:37 EST
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@xxxxxxx>
---
Changes in V3:
- Replace open-coded pm_runtime_get_if_active()/pm_runtime_put() pair
with the PM_RUNTIME_ACQUIRE_IF_ACTIVE() guard macro
---
drivers/dma/xilinx/zynqmp_dma.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 87986f65d24c..b03171e37e27 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -729,6 +729,11 @@ 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 (IS_ENABLED(CONFIG_PM) && pm_runtime_enabled(chan->dev) &&
+ 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