DMA Engine development
 help / color / mirror / Atom feed
* [PATCH 0/3] dmaengine: Remove obsolete 32-bit DMA mask fallbacks
@ 2026-09-03 11:54 Ruizhe Zhou
  2026-09-03 11:54 ` [PATCH 1/3] dmaengine: ptdma: Remove obsolete 32-bit DMA mask fallback Ruizhe Zhou
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ruizhe Zhou @ 2026-09-03 11:54 UTC (permalink / raw)
  To: Vinod Koul, Basavaraj Natikar, Logan Gunthorpe, Orson Zhai,
	Baolin Wang
  Cc: Frank Li, Chunyan Zhang, dmaengine, linux-kernel, Ruizhe Zhou

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-04 11:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 11:54 [PATCH 0/3] dmaengine: Remove obsolete 32-bit DMA mask fallbacks Ruizhe Zhou
2026-09-03 11:54 ` [PATCH 1/3] dmaengine: ptdma: Remove obsolete 32-bit DMA mask fallback Ruizhe Zhou
2026-09-03 19:26   ` Frank Li
2026-09-04 11:15     ` 周睿哲
2026-09-03 11:54 ` [PATCH 2/3] dmaengine: plx_dma: " Ruizhe Zhou
2026-09-03 14:29   ` sashiko-bot
2026-09-03 22:00   ` Logan Gunthorpe
2026-09-03 11:54 ` [PATCH 3/3] dmaengine: sprd: " Ruizhe Zhou
2026-09-03 14:26   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox