linux/arch/powerpc
Gaurav Batra 328335a794 powerpc/powernv/iommu: iommu incorrectly bypass DMA APIs
In a PowerNV environment, for devices that supports DMA mask less than
64 bit but larger than 32 bits, iommu is incorrectly bypassing DMA
APIs while allocating and mapping buffers for DMA operations.

Devices are failing with ENOMEN during probe with the following messages

amdgpu 0000:01:00.0: [drm] Detected VRAM RAM=4096M, BAR=4096M
amdgpu 0000:01:00.0: [drm] RAM width 128bits GDDR5
amdgpu 0000:01:00.0: iommu: 64-bit OK but direct DMA is limited by 0
amdgpu 0000:01:00.0: dma_iommu_get_required_mask: returning bypass mask 0xfffffffffffffff
amdgpu 0000:01:00.0:  4096M of VRAM memory ready
amdgpu 0000:01:00.0:  32570M of GTT memory ready.
amdgpu 0000:01:00.0: (-12) failed to allocate kernel bo
amdgpu 0000:01:00.0: [drm] Debug VRAM access will use slowpath MM access
amdgpu 0000:01:00.0: [drm] GART: num cpu pages 4096, num gpu pages 65536
amdgpu 0000:01:00.0: [drm] PCIE GART of 256M enabled (table at 0x000000F4FFF80000).
amdgpu 0000:01:00.0: (-12) failed to allocate kernel bo
amdgpu 0000:01:00.0: (-12) create WB bo failed
amdgpu 0000:01:00.0: amdgpu_device_wb_init failed -12
amdgpu 0000:01:00.0: amdgpu_device_ip_init failed
amdgpu 0000:01:00.0: Fatal error during GPU init
amdgpu 0000:01:00.0: finishing device.
amdgpu 0000:01:00.0: probe with driver amdgpu failed with error -12
amdgpu 0000:01:00.0:  ttm finalized

Fixes: 1471c517cf ("powerpc/iommu: bypass DMA APIs for coherent allocations for pre-mapped memory")
Suggested-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reported-by: Dan Horák <dan@danny.cz>
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5039
Tested-by: Dan Horak <dan@danny.cz>
Closes: https://lore.kernel.org/linuxppc-dev/20260313142351.609bc4c3efe1184f64ca5f44@danny.cz/
Signed-off-by: Gaurav Batra <gbatra@linux.ibm.com>
Closes: https://lore.kernel.org/linuxppc-dev/20260313142351.609bc4c3efe1184f64ca5f44@danny.cz/
[Maddy: Fixed tags]
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260331223022.47488-1-gbatra@linux.ibm.com
2026-04-01 22:08:55 +05:30
..
boot powerpc: dts: mpc83xx: Add unit addresses to /memory 2026-03-07 16:02:27 +05:30
configs mm.git review status for linus..mm-nonmm-stable 2026-02-12 12:13:01 -08:00
crypto lib/crypto: powerpc/aes: Migrate POWER8 optimized code into library 2026-01-12 11:39:58 -08:00
include powerpc: fix KUAP warning in VMX usercopy path 2026-03-12 11:03:47 +05:30
kernel powerpc/powernv/iommu: iommu incorrectly bypass DMA APIs 2026-04-01 22:08:55 +05:30
kexec powerpc/crash: adjust the elfcorehdr size 2026-03-04 11:12:48 +05:30
kvm KVM: PPC: e500: Rip out "struct tlbe_ref" 2026-03-11 18:41:10 +01:00
lib powerpc: fix KUAP warning in VMX usercopy path 2026-03-12 11:03:47 +05:30
math-emu
mm powerpc/mem: Move CMA reservations to arch_mm_preinit 2026-03-12 10:57:31 +05:30
net powerpc64/bpf: fix kfunc call support 2026-03-07 16:02:26 +05:30
perf powerpc, perf: Check that current->mm is alive before getting user callchain 2026-03-12 11:02:55 +05:30
platforms powerpc/pseries: Correct MSI allocation tracking 2026-03-07 16:02:28 +05:30
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
tools powerpc64/ftrace: fix OOL stub count with clang 2026-03-07 16:02:25 +05:30
xmon powerpc/xmon: replace sizeof calculations with ARRAY_SIZE macro 2025-09-01 13:40:46 +05:30
Kbuild powerpc64/ftrace: Move ftrace sequence out of line 2024-10-31 11:00:54 +11:00
Kconfig powerpc64: make clang cross-build friendly 2026-03-07 16:02:25 +05:30
Kconfig.debug powerpc: Remove UDBG_RTAS_CONSOLE 2025-02-26 21:15:09 +05:30
Makefile kbuild: Add missing $(objtree) prefix to powerpc crtsavres.o artifact 2025-09-01 13:41:57 +05:30
Makefile.postlink powerpc/ftrace: Add a postlink script to validate function tracer 2024-10-31 11:00:54 +11:00