linux/drivers/gpu
Mikhail Gavrilov 9920249a52 drm/amdgpu: convert amdgpu_vm_lock_by_pasid() to drm_exec
amdgpu_vm_lock_by_pasid() looks up a VM by PASID and reserves its root
PD with a bare amdgpu_bo_reserve(), returning the still-reserved root to
the caller. A caller that then needs to reserve further BOs (for example
the devcoredump IB dump) ends up nesting reservation_ww_class_mutex
acquires without a ww_acquire_ctx, which lockdep flags as recursive
locking.

Convert the helper to take a drm_exec context and lock the root PD with
drm_exec_lock_obj(). Callers now run it inside a
drm_exec_until_all_locked() loop and can lock additional BOs in the same
ww ticket, so there is no nested ww_mutex acquire.

The drm_exec context holds its own reference on the locked root BO, so
the helper no longer hands a root reference back to the caller: the
root output parameter is dropped, and the transient reference taken
across the PASID lookup is released before returning.

The only existing caller, amdgpu_vm_handle_fault(), is updated
accordingly. Its is_compute_context path, which previously dropped the
root reservation around svm_range_restore_pages() and re-took it, now
finalises the drm_exec context and re-initialises a fresh one; behaviour
is otherwise unchanged.

No functional change intended for the page-fault path.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 14682de8ad)
2026-06-17 18:23:43 -04:00
..
drm drm/amdgpu: convert amdgpu_vm_lock_by_pasid() to drm_exec 2026-06-17 18:23:43 -04:00
host1x gpu: host1x: Fix iommu_map_sgtable() return value check 2026-05-28 17:19:30 +02:00
ipu-v3
nova-core gpu: nova-core: move lifetime to Bar0 2026-06-03 22:10:51 +02:00
tests gpu/tests/gpu_buddy: Add gpu_test_buddy_alloc_range for exact-range allocation 2026-03-09 13:58:12 +05:30
trace
vga
buddy.c drm/buddy: Integrate lockdep annotations for gpu buddy manager 2026-05-08 19:16:19 +05:30
Kconfig
Makefile gpu: Fix uninitialized buddy for built-in drivers 2026-02-24 13:40:59 +10:00