linux/drivers/dma
Tomi Valkeinen a17ce4bc6f dmaengine: xilinx_dma: Fix reset related timeout with two-channel AXIDMA
A single AXIDMA controller can have one or two channels. When it has two
channels, the reset for both are tied together: resetting one channel
resets the other as well. This creates a problem where resetting one
channel will reset the registers for both channels, including clearing
interrupt enable bits for the other channel, which can then lead  to
timeouts as the driver is waiting for an interrupt which never comes.

The driver currently has a probe-time work around for this: when a
channel is created, the driver also resets and enables the
interrupts. With two channels the reset for the second channel will
clear the interrupt enables for the first one. The work around in the
driver is just to manually enable the interrupts again in
xilinx_dma_alloc_chan_resources().

This workaround only addresses the probe-time issue. When channels are
reset at runtime (e.g., in xilinx_dma_terminate_all() or during error
recovery), there's no corresponding mechanism to restore the other
channel's interrupt enables. This leads to one channel having its
interrupts disabled while the driver expects them to work, causing
timeouts and DMA failures.

A proper fix is a complicated matter, as we should not reset the other
channel when it's operating normally. So, perhaps, there should be some
kind of synchronization for a common reset, which is not trivial to
implement. To add to the complexity, the driver also supports other DMA
types, like VDMA, CDMA and MCDMA, which don't have a shared reset.

However, when the two-channel AXIDMA is used in the (assumably) normal
use case, providing DMA for a single memory-to-memory device, the common
reset is a bit smaller issue: when something bad happens on one channel,
or when one channel is terminated, the assumption is that we also want
to terminate the other channel. And thus resetting both at the same time
is "ok".

With that line of thinking we can implement a bit better work around
than just the current probe time work around: let's enable the
AXIDMA interrupts at xilinx_dma_start_transfer() instead.
This ensures interrupts are enabled whenever a transfer starts,
regardless of any prior resets that may have cleared them.

This approach is also more logical: enable interrupts only when needed
for a transfer, rather than at resource allocation time, and, I think,
all the other DMA types should also use this model, but I'm reluctant to
do such changes as I cannot test them.

The reset function still enables interrupts even though it's not needed
for AXIDMA anymore, but it's common code for all DMA types (VDMA, CDMA,
MCDMA), so leave it unchanged to avoid affecting other variants.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fixes: c0bba3a99f ("dmaengine: vdma: Add Support for Xilinx AXI Direct Memory Access Engine")
Link: https://patch.msgid.link/20260311-xilinx-dma-fix-v2-1-a725abb66e3c@ideasonboard.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-17 16:33:32 +05:30
..
amd treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
bestcomm Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dw Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dw-axi-dmac treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dw-edma dmaengine: dw-edma: Fix multiple times setting of the CYCLE_STATE and CYCLE_BIT bits for HDMA. 2026-03-09 08:15:54 +01:00
fsl-dpaa2-qdma Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hsu treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
idxd dmaengine: idxd: fix possible wrong descriptor completion in llist_abort_desc() 2026-03-09 12:27:11 +01:00
ioat Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
lgm treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
mediatek treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ppc4xx Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
qcom treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
sf-pdma treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
sh dmaengine: sh: rz-dmac: Move CHCTRL updates under spinlock 2026-03-17 16:11:11 +05:30
stm32 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ti Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xilinx dmaengine: xilinx_dma: Fix reset related timeout with two-channel AXIDMA 2026-03-17 16:33:32 +05:30
Kconfig dmaengine: st_fdma: add COMPILE_TEST support 2025-12-23 16:35:27 +05:30
Makefile dmaengine: add driver for Sophgo CV18XX/SG200X dmamux 2025-06-17 11:26:13 +05:30
TODO
acpi-dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
altera-msgdma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
amba-pl08x.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
apple-admac.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
arm-dma350.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
at_hdmac.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
at_xdmac.c dmaengine: at_xdmac: get the number of DMA channels from device tree 2026-01-01 17:15:16 +05:30
bcm-sba-raid.c dmaengine: bcm-sba-raid: fix device leak on probe 2025-12-14 14:47:24 +05:30
bcm2835-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
cv1800b-dmamux.c dmaengine: cv1800b-dmamux: fix device leak on route allocation 2025-12-14 14:47:24 +05:30
dma-axi-dmac.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dma-jz4780.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dmaengine.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dmaengine.h dmaengine: dmaengine_desc_callback_valid(): Check for `callback_result` 2021-10-25 09:42:56 +05:30
dmatest.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ep93xx_dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl-edma-common.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
fsl-edma-common.h dmaegnine: fsl-edma: add edma error interrupt handler 2025-04-23 18:42:46 +05:30
fsl-edma-main.c dmaengine: fsl-edma: fix channel parameter config for fixed channel requests 2026-02-25 14:55:10 +05:30
fsl-edma-trace.c dmaengine: fsl-edma: add trace event support 2024-05-04 18:00:16 +05:30
fsl-edma-trace.h dmaengine: fsl-edma: add trace event support 2024-05-04 18:00:16 +05:30
fsl-qdma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_raid.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsl_raid.h
fsldma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fsldma.h fsldma: Set correct dma_mask based on hw capability 2025-05-14 15:25:15 +01:00
hisi_dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
idma64.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
idma64.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
img-mdc-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
imx-dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
imx-sdma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
k3dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
loongson1-apb-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
loongson2-apb-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
lpc18xx-dmamux.c dmaengine: lpc18xx-dmamux: fix device leak on route allocation 2025-12-14 14:47:24 +05:30
lpc32xx-dmamux.c dmaengine: lpc32xx-dmamux: fix device leak on route allocation 2025-12-14 14:47:24 +05:30
mcf-edma-main.c dmaengine: Switch back to struct platform_driver::remove() 2024-10-14 23:50:34 +05:30
milbeaut-hdmac.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
milbeaut-xdmac.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
mmp_pdma.c dmaengine: mmp_pdma: Fix race condition in mmp_pdma_residue() 2025-12-16 20:28:39 +05:30
mmp_tdma.c dmaengine: mmp_tdma: drop unnecessary OF node check in remove 2025-11-21 17:42:51 +05:30
moxart-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
mpc512x_dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mv_xor.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mv_xor.h dmaengine: Fix spelling mistakes 2024-09-02 13:56:01 +05:30
mv_xor_v2.c dmaengine: fix typo in the comment 2024-10-21 23:07:08 +05:30
mxs-dma.c dmaengine: Explicitly include correct DT includes 2023-08-01 23:51:27 +05:30
nbpfaxi.c dmaengine: nbpfaxi: Convert to RUNTIME_PM_OPS() 2025-10-16 17:41:52 +05:30
of-dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
owl-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pch_dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pl330.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
plx_dma.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
pxa_dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sa11x0-dma.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sprd-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
st_fdma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
st_fdma.h dmaengine: st_fdma: change dreg_line to long 2025-12-23 16:35:27 +05:30
ste_dma40.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ste_dma40.h dmaengine: Fix spelling mistakes 2024-09-02 13:56:01 +05:30
ste_dma40_ll.c dmaengine: ste_dma40: Remove platform data 2023-05-16 23:00:19 +05:30
ste_dma40_ll.h dmaengine: Fix spelling mistakes 2024-09-02 13:56:01 +05:30
sun4i-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
sun6i-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
tegra20-apb-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
tegra186-gpc-dma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
tegra210-adma.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
timb_dma.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
txx9dmac.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
txx9dmac.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
uniphier-mdmac.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
uniphier-xdmac.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
virt-dma.c dmaengine: virt-dma: add missing MODULE_DESCRIPTION() macro 2024-06-28 13:03:13 +05:30
virt-dma.h dma: Add lockdep asserts to virt-dma 2024-04-07 17:08:19 +05:30
xgene-dma.c dmaengine: Switch back to struct platform_driver::remove() 2024-10-14 23:50:34 +05:30