[PATCH v2 0/3] dmaengine: sun4i: retain cyclic descriptors until callbacks drain

From: James Hilliard

Date: Sun Nov 15 2026 - 04:06:58 EST


Retain descriptors through callback synchronization using a shared virt-dma
termination helper, then use it to fix sun4i cyclic callback lifetime
and IRQ serialization. The helper keeps termination usable in atomic
context while callbacks finish in process-context synchronization.

Also serialize pending IRQ handling with physical-channel reuse so an
old transfer's interrupt state cannot complete its replacement or disable
the replacement's interrupts.

Assisted-by: Codex:gpt-6-astra
Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>

---
Changes in v2:
- Add a shared virt-dma descriptor-retirement helper before the sun4i
fix, following Frank's review.
- Retain all collected descriptors until synchronization, avoiding
provider-specific cyclic checks and preserving repeated termination.
- Retire pending IRQ state before physical-channel reuse and acknowledge
events under the owning virtual channel's lock in a separate fix.
- Link to v1: https://patch.msgid.link/20261103-submit-sun4i-dma-callback-lifetime-v1-v1-1-4c5a0653104f@xxxxxxxxx

---
James Hilliard (3):
dmaengine: virt-dma: share deferred descriptor retirement
dmaengine: sun4i: retain cyclic descriptors until callbacks drain
dmaengine: sun4i: retire interrupt state before channel reuse

drivers/dma/sun4i-dma.c | 68 +++++++++++++++++++++++++++++--------------------
drivers/dma/virt-dma.h | 20 ++++++++++++++-
2 files changed, 59 insertions(+), 29 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261103-submit-sun4i-dma-callback-lifetime-v1-b6192060b76f

Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>