[PATCH 0/3] dmaengine: Remove obsolete 32-bit DMA mask fallbacks
From: Ruizhe Zhou
Date: Thu Sep 03 2026 - 08:51:12 EST
A few DMAengine drivers set a >32 bit DMA mask and retry with a 32-bit
mask if the first call fails. This treats the return value of
dma_set_mask_and_coherent() as an indication that the platform requires
a narrower DMA width.
That is not a correct interpretation of dma_set_mask_and_coherent().
The mask passed to the DMA API describes the highest address a device can
reach. It asks the DMA layer to keep mappings within that limit; it is not
a probe asking the platform which addressing mode the device should use.
A wider mask includes every address permitted by a 32-bit mask, including
addresses from a platform that only produces 32-bit DMA addresses.
Since commit 91ef26f914171 ("dma-direct: relax addressability checks in
dma_direct_supported"), the DMA API guarantees support for masks
of 32 bits or wider. A failed wider request is therefore not evidence that
the driver should advertise a smaller capability. Retrying with a 32-bit
mask cannot repair the underlying DMA setup failure. The DMA API HOWTO
explicitly identifies this fallback pattern as incorrect [1]. See [2] and
[3] for details.
This series removes the fallbacks from the AMD PTDMA, PLX and
Spreadtrum DMA drivers without changing the mask selected for each device.
The return-value checks are retained. DMA setup errors are still reported
and still abort device initialization.
Testing was compile-only. No hardware testing was performed.
[1] DMA API HOWTO, "DMA addressing capabilities"
https://docs.kernel.org/core-api/dma-api-howto.html#dma-addressing-capabilities
[2] commit 91ef26f914171 ("dma-direct: relax addressability checks in
dma_direct_supported")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=91ef26f914171cf753330f13724fd9142b5b1640
[3] commit f7ae20f2fc4e ("docs: dma: correct dma_set_mask() sample code")
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f7ae20f2fc4e
Best regards,
Ruizhe Zhou
Ruizhe Zhou (3):
dmaengine: ptdma: Remove obsolete 32-bit DMA mask fallback
dmaengine: plx_dma: Remove obsolete 32-bit DMA mask fallback
dmaengine: sprd: Remove obsolete 32-bit DMA mask fallback
drivers/dma/amd/ptdma/ptdma-pci.c | 8 ++------
drivers/dma/plx_dma.c | 2 --
drivers/dma/sprd-dma.c | 7 ++-----
3 files changed, 4 insertions(+), 13 deletions(-)
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
--
2.27.0