[PATCH 0/2] RDMA: Remove obsolete 32-bit DMA mask fallbacks

From: Ruizhe Zhou

Date: Wed Aug 12 2026 - 02:00:57 EST


hfi1 and mlx5 data direct both set a 64-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 describes the DMA addresses the device can accept and constrains
subsequent mappings to that range. A 64-bit mask includes every address
permitted by a 32-bit mask, including addresses from a platform that only
produces 32-bit DMA addresses. Retrying with 32 bits therefore adds a stricter
constraint and cannot correct a failure to establish the 64-bit mask.
The DMA API HOWTO explicitly calls this fallback pattern incorrect [1].
See [2] and [3] for details.

This series removes both fallbacks while retaining the return-value
checks. 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] DMA direct addressability change, commit 91ef26f91417
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=91ef26f914171cf753330f13724fd9142b5b1640

[3] DMA HOWTO correction, commit f7ae20f2fc4e
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f7ae20f2fc4e

Ruizhe Zhou (2):
RDMA/hfi1: Remove obsolete 32-bit DMA mask fallback
RDMA/mlx5: Remove obsolete 32-bit DMA mask fallback

drivers/infiniband/hw/hfi1/pcie.c | 14 +++-----------
drivers/infiniband/hw/mlx5/data_direct.c | 10 +++-------
2 files changed, 6 insertions(+), 18 deletions(-)


base-commit: a12d9145145b21c50531afb6e3f711b1f34e1465
--
2.27.0