[PATCH v7 0/2] dmaengine: fsl-edma: Scatter/gather improvements

From: Benoît Monin

Date: Tue Jul 28 2026 - 10:11:38 EST


This series adds support for scatter/gather DMA transfers via dma_vec
and dynamic descriptor chaining to the Freescale eDMA controller driver.

The first patch implements the .device_prep_peripheral_dma_vec() callback,
enabling the DMA engine to accept an array of dma_vec structures. This
callback supports both regular and cyclic transfer modes.

The second patch introduces dynamic scatter/gather chaining, which allows
multiple DMA descriptors to be linked together without stopping the channel.
This optimization eliminates idle periods when back-to-back transfers are
submitted, improving throughput and reducing latency. The implementation
carefully preserves cyclic transfer semantics and respects hardware
constraints on platforms with split register layouts.

I tested it on the i.MX93. The dynamic scatter/gather chaining should
work with other eDMA controller with split register layout.

Signed-off-by: Benoît Monin <benoit.monin@xxxxxxxxxxx>
---
Changes in v7:
- In fsl_edma_prep_peripheral_dma_vec(), make sure that CITER/BITER
values fit in their registers.
- Add the identifier to all TCD of a linked transaction so that we can
always identify it when handling the end-of-transfer interrupt.
- Handle missed/coalesced end-of-transfer interrupt even when the transfer
is completed.
- Link to v6: https://patch.msgid.link/20260710-fsl-edma-dyn-sg-v6-0-831b96be3f31@xxxxxxxxxxx

Changes in v6:
- Link DMA transactions in fsl_edma_issue_pending() when they are issued,
not when submitted.
- Add an identifier to linked transactions to handle missed/coalesced
end-of-transfer interrupt.
- Link to v5: https://patch.msgid.link/20260702-fsl-edma-dyn-sg-v5-0-16787185be49@xxxxxxxxxxx

Changes in v5:
- Rebased on v7.2-rc1.
- Add a call to dma_wmb() to ensure that dlast_sga is updated
before csr when linking scatter/gather transactions.
- Don't update TCD registers if updating csr requires clearing the
channel DONE bit to avoid a status mismatch in fsl_edma_tx_chan_handler().
- Link to v4: https://patch.msgid.link/20260518-fsl-edma-dyn-sg-v4-0-8ce7d95b1ce9@xxxxxxxxxxx

Changes in v4:
- To keep transactions in order, link DMA transaction to the end of
submitted list first, only lookup the issued list is the submitted
list is empty.
- Link to v3: https://patch.msgid.link/20260511-fsl-edma-dyn-sg-v3-0-98a181775dae@xxxxxxxxxxx

Changes in v3:
- Fix formatting errors reported by Frank Li.
- Add fsl_edma_tx_submit() to link the DMA transactions
when they are submitted, not when they are prepared.
- Link to v2: https://patch.msgid.link/20260506-fsl-edma-dyn-sg-v2-0-66439cdd414e@xxxxxxxxxxx

Changes in v2:
- Drop the RFC prefix, as asked by Frank Li
- No code change
- Link to v1: https://patch.msgid.link/20260430-fsl-edma-dyn-sg-v1-0-4e0ecbe2df66@xxxxxxxxxxx

To: Frank Li <Frank.Li@xxxxxxx>
To: Vinod Koul <vkoul@xxxxxxxxxx>
Cc: Thomas Petazzoni <thomas.petazzoni@xxxxxxxxxxx>
Cc: Frank Li <Frank.Li@xxxxxxxxxx>
Cc: imx@xxxxxxxxxxxxxxx
Cc: dmaengine@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

---
Benoît Monin (2):
dmaengine: fsl-edma: Implement device_prep_peripheral_dma_vec
dmaengine: fsl-edma: Support dynamic scatter/gather chaining

drivers/dma/fsl-edma-common.c | 227 ++++++++++++++++++++++++++++++++++++++++--
drivers/dma/fsl-edma-common.h | 7 ++
drivers/dma/fsl-edma-main.c | 2 +
drivers/dma/fsl-edma-trace.h | 5 +
4 files changed, 234 insertions(+), 7 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260428-fsl-edma-dyn-sg-960731e37da2

Best regards,
--
Benoît Monin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com