]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
powerpc/iommu: bypass DMA APIs for coherent allocations for pre-mapped memory
authorGaurav Batra <gbatra@linux.ibm.com>
Fri, 7 Nov 2025 16:11:05 +0000 (10:11 -0600)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 7 Jan 2026 04:03:55 +0000 (09:33 +0530)
commit1471c517cf7dae1a6342fb821d8ed501af956dd0
tree8adae503ae559b9eb3fe6e6f5ffd86854621fe24
parent20ab1d11265350a9ea3d315d6c70170b8198f329
powerpc/iommu: bypass DMA APIs for coherent allocations for pre-mapped memory

Leverage ARCH_HAS_DMA_MAP_DIRECT config option for coherent allocations as
well. This will bypass DMA ops for memory allocations that have been
pre-mapped.

Always set device bus_dma_limit when memory is pre-mapped. In some
architectures, like PowerPC, pmemory can be converted to regular memory via
daxctl command. This will gate the coherent allocations to pre-mapped RAM
only, by dma_coherent_ok().

Signed-off-by: Gaurav Batra <gbatra@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20251107161105.85999-1-gbatra@linux.ibm.com
arch/powerpc/kernel/dma-iommu.c
arch/powerpc/platforms/pseries/iommu.c
include/linux/dma-map-ops.h
kernel/dma/mapping.c