[PATCH v4 0/9] dmaengine: sun6i: fix interrupt routing and channel lifetime
From: James Hilliard
Date: Sun Nov 15 2026 - 04:33:20 EST
Correct interrupt routing and serialize physical-channel ownership across
allocation, completion, pause and termination. Keep paused virtual channels
off the allocator, drain completion callbacks before releasing resources,
and associate cyclic state with the descriptor that owns it.
The first patch carries Hongling Zeng's physical-channel indexing fix [0],
adapted to the configurable interrupt-bank size introduced for A733. The
second handles partially populated banks, including H3's twelve channels.
The ownership work is split into lock ordering, physical-channel locking,
completed-descriptor retirement and interrupt cleanup. Pause bookkeeping,
callback synchronization and per-descriptor cyclic state follow separately.
Based on DMAengine next at 6628e7d4c6b, with the posted IRQ-safe locking
fix [1], channel pause-bit fix [2], and shared virt-dma synchronization
helper [3] applied first. The synchronization patch uses that helper for
the sun6i device_synchronize callback.
[0] https://lore.kernel.org/r/20260706064123.66035-1-zenghongling@xxxxxxxxxx
[1] https://lore.kernel.org/r/20260926171049.841335-1-tien.nguyenminh@xxxxxxxxxxxxxxxxxx
[2] https://lore.kernel.org/r/20261021-submit-sun6i-dma-pause-bit-v1-v1-1-38d286b69dab@xxxxxxxxx
[3] https://lore.kernel.org/r/20261027-submit-mtk-uart-dma-synchronize-v1-v3-1-aad7a6b3c62e@xxxxxxxxx
Assisted-by: Codex:gpt-6-astra
Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
---
Changes in v4:
- Explain that reading the pause register flushes the MMIO request
before returning to the client, following Frank's review.
- Collect Frank's Reviewed-by tags on the interrupt-bank, lock-ordering,
ownership, completion, interrupt-retirement, synchronization and
cyclic-mode patches.
- Rebase onto current DMAengine next, retaining the upstream residue
snapshot and NULL-descriptor fixes.
- Use the standalone shared virt-dma helper from MediaTek synchronization
v3 as a prerequisite.
- Link to v3: https://patch.msgid.link/20261023-submit-sun6i-dma-lifetime-next-v1-v3-0-ef1acb0be768@xxxxxxxxx
Changes in v3:
- Split the ownership patch into four commits covering lock ordering,
physical-channel locking, completed-descriptor retirement and interrupt
cleanup, following Frank Li's review.
- Document why virt-dma still takes vc.lock independently of sdev->lock.
- Check pending interrupt status first in the per-bank loop condition.
- Link to v2: https://lore.kernel.org/r/20261023-submit-sun6i-dma-lifetime-next-v1-v2-0-c9e07cc44bf8@xxxxxxxxx
Changes in v2:
- Clear the active descriptor pointer before handing finite completion to
virt-dma, replacing the completed-descriptor pointer.
- Release completed physical channels while their virtual channels remain
paused, and clear the hardware pause request before reassignment.
- Keep the ownership changes in patch 3 and the pause policy in patch 4.
- Link to v1: https://lore.kernel.org/r/20261022-submit-sun6i-dma-lifetime-next-v1-v1-0-01085f684c9f@xxxxxxxxx
To: Vinod Koul <vkoul@xxxxxxxxxx>
To: Frank Li <Frank.Li@xxxxxxxxxx>
To: Chen-Yu Tsai <wens@xxxxxxxxxx>
To: Jernej Skrabec <jernej.skrabec@xxxxxxxxx>
To: Samuel Holland <samuel@xxxxxxxxxxxx>
To: Arnd Bergmann <arnd@xxxxxxxx>
To: Maxime Ripard <mripard@xxxxxxxxxx>
To: Jens Kuske <jenskuske@xxxxxxxxx>
To: Jean-Francois Moine <moinejf@xxxxxxx>
Cc: dmaengine@xxxxxxxxxxxxxxx
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-sunxi@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
Hongling Zeng (1):
dmaengine: sun6i: fix physical channel index in interrupt handler
James Hilliard (8):
dmaengine: sun6i: handle the last partial interrupt bank
dmaengine: sun6i: take the device lock before the virtual channel lock
dmaengine: sun6i: serialize physical channel ownership
dmaengine: sun6i: detach completed descriptors before invoking callbacks
dmaengine: sun6i: retire interrupt state before reusing physical channels
dmaengine: sun6i: track paused virtual channels
dmaengine: sun6i: synchronize callbacks before releasing channel resources
dmaengine: sun6i: keep cyclic state with the prepared descriptor
drivers/dma/sun6i-dma.c | 184 ++++++++++++++++++++++++++++--------------------
1 file changed, 107 insertions(+), 77 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261022-submit-sun6i-dma-lifetime-next-v1-53c3158f4841
prerequisite-patch-id: d6398447647aa0dbb005b5e6dc6ba96e642efa86
prerequisite-patch-id: f67c1f8d8d9e014cc650f2f37648662430c3b77b
prerequisite-patch-id: 43704b0efab7679ada5f06b959a501040573409a
Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>