linux/drivers/dma/dw-edma
Koichiro Den 0d995da5fb dmaengine: dw-edma: Mark emulated IRQ as level-triggered
The interrupt-emulation virtual IRQ uses handle_level_irq(), but the IRQ
descriptor has not been marked with IRQ_LEVEL.

The interrupt emulation is somewhat unusual: the eDMA interrupt handlers
dispatch the virtual IRQ for every edma_int[] interrupt because software
cannot reliably tell an interrupt-emulation event from one caused solely
by DONE/ABORT status. If an interrupt arrives before the doorbell
handler is registered for the virtual IRQ, the IRQ core marks it
pending. When the IRQ is later started, check_irq_resend() treats it as
non-level and replays the pending interrupt, causing the newly
registered handler to run for a stale event.

Mark the virtual IRQ with IRQ_LEVEL so the stale pending state is
cleared without being replayed. This was observed in pci_endpoint_test
as two doorbell handler calls when the DMA-variant test ran before
DOORBELL_TEST.

Fixes: d9d5e1bdd1 ("dmaengine: dw-edma: Add virtual IRQ for interrupt-emulation doorbells")
Cc: stable@vger.kernel.org
Reported-by: Niklas Cassel <cassel@kernel.org>
Closes: https://lore.kernel.org/r/ampndLtU32ODmncX@ryzen
Tested-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260730160701.3550710-1-den@valinux.co.jp
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-08-12 00:16:54 +05:30
..
dw-edma-core.c dmaengine: dw-edma: Mark emulated IRQ as level-triggered 2026-08-12 00:16:54 +05:30
dw-edma-core.h dmaengine: dw-edma: Program endpoint function numbers 2026-07-21 16:00:36 +05:30
dw-edma-pcie.c dmaengine: dw-edma: Program endpoint function numbers 2026-07-21 16:00:36 +05:30
dw-edma-v0-core.c dmaengine: dw-edma: Program endpoint function numbers 2026-07-21 16:00:36 +05:30
dw-edma-v0-core.h dmaengine: dw-edma: Create a new dw_edma_core_ops structure to abstract controller operation 2023-05-24 12:20:45 +05:30
dw-edma-v0-debugfs.c dmaengine: dw-edma: increase size of 'name' in debugfs code 2024-01-19 18:17:34 +05:30
dw-edma-v0-debugfs.h dmaengine: dw-edma: Use DMA engine device debugfs subdirectory 2023-02-10 17:15:23 -06:00
dw-edma-v0-regs.h dmaengine: dw-edma: Fix comments offset characters' alignment 2021-03-16 22:58:52 +05:30
dw-hdma-v0-core.c dmaengine: dw-edma: Program endpoint function numbers 2026-07-21 16:00:36 +05:30
dw-hdma-v0-core.h dmaengine: dw-edma: Add support for native HDMA 2023-05-24 12:20:45 +05:30
dw-hdma-v0-debugfs.c dmaengine: dw-edma: increase size of 'name' in debugfs code 2024-01-19 18:17:34 +05:30
dw-hdma-v0-debugfs.h dmaengine: dw-edma: Add HDMA DebugFS support 2023-05-24 12:20:45 +05:30
dw-hdma-v0-regs.h dmaengine: dw-edma: Program endpoint function numbers 2026-07-21 16:00:36 +05:30
Kconfig dmaengine: dw-edma: Depend on DW_EDMA instead of selecting it 2023-02-22 13:46:04 -06:00
Makefile dmaengine: dw-edma: Add HDMA DebugFS support 2023-05-24 12:20:45 +05:30