[PATCH v3 0/2] dmaengine: share virt-dma synchronization and use it for UART APDMA
From: James Hilliard
Date: Tue Oct 27 2026 - 14:44:31 EST
Provide a virt-dma synchronization helper with the DMAengine callback
signature and use it in drivers whose synchronization callbacks only
convert the channel and call vchan_synchronize().
Use the shared callback for MediaTek UART APDMA so clients can wait for
completion callbacks before reusing callback state or freeing DMA
buffers. The shared helper and existing-driver conversions form the
preparatory patch, followed by the UART APDMA fix.
Assisted-by: Codex:gpt-6-astra
Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
Changes in v3:
- Split the shared helper and existing-driver conversions into a separate
preparatory patch, leaving the UART APDMA callback assignment in the
second patch, as requested by Frank Li [1].
- Replace 26 equivalent driver-local synchronization wrappers with the
shared helper in the preparatory patch.
- Link to v2: https://patch.msgid.link/20261022-submit-mtk-uart-dma-synchronize-v1-v2-1-fdaef0e2edd6@xxxxxxxxx
Changes in v2:
- Add a documented vchan_dma_synchronize(struct dma_chan *) helper in
virt-dma.h and use it directly as the UART APDMA device_synchronize
callback, following Frank Li's review [0].
- Link to v1: https://patch.msgid.link/20261021-submit-mtk-uart-dma-synchronize-v1-v1-1-4f7718cfef41@xxxxxxxxx
[0] https://lore.kernel.org/r/atoz6M7RHU14_a3J@SMW015318/
[1] https://lore.kernel.org/r/auDOqLln9_ra__hY@lizhi-Precision-Tower-5810/
---
James Hilliard (2):
dmaengine: virt-dma: share the DMAengine synchronization callback
dmaengine: mediatek: uart: synchronize completion callbacks
drivers/dma/amba-pl08x.c | 11 ++---------
drivers/dma/amd/ptdma/ptdma-dmaengine.c | 9 +--------
drivers/dma/arm-dma350.c | 9 +--------
drivers/dma/bcm2835-dma.c | 9 +--------
drivers/dma/dma-axi-dmac.c | 9 +--------
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 9 +--------
drivers/dma/fsl-edma-main.c | 9 +--------
drivers/dma/fsl-qdma.c | 9 +--------
drivers/dma/hisi_dma.c | 9 +--------
drivers/dma/hsu/hsu.c | 9 +--------
drivers/dma/idma64.c | 9 +--------
drivers/dma/img-mdc-dma.c | 9 +--------
drivers/dma/k3dma.c | 9 +--------
drivers/dma/loongson/loongson1-apb-dma.c | 7 +------
drivers/dma/loongson/loongson2-apb-cmc-dma.c | 9 +--------
drivers/dma/loongson/loongson2-apb-dma.c | 14 +-------------
drivers/dma/mediatek/mtk-uart-apdma.c | 1 +
drivers/dma/milbeaut-hdmac.c | 7 +------
drivers/dma/milbeaut-xdmac.c | 7 +------
drivers/dma/stm32/stm32-dma.c | 9 +--------
drivers/dma/stm32/stm32-dma3.c | 9 +--------
drivers/dma/stm32/stm32-mdma.c | 9 +--------
drivers/dma/tegra210-adma.c | 9 +--------
drivers/dma/ti/edma.c | 11 ++---------
drivers/dma/ti/omap-dma.c | 9 +--------
drivers/dma/uniphier-mdmac.c | 7 +------
drivers/dma/uniphier-xdmac.c | 7 +------
drivers/dma/virt-dma.h | 15 +++++++++++++++
28 files changed, 44 insertions(+), 205 deletions(-)
---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20261021-submit-mtk-uart-dma-synchronize-v1-158c8303b574
Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>