]> www.infradead.org Git - nvme.git/commit
drm/amdkfd: Ensure user queue buffers residency
authorPhilip Yang <Philip.Yang@amd.com>
Thu, 20 Jun 2024 16:31:36 +0000 (12:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Jul 2024 21:42:54 +0000 (17:42 -0400)
commit834368eab36922595a402b9e76470f8efa2fac7f
tree51d83dba64bc1d07dc6141c8422040df547f39a5
parent22a9d5cbf88a92ac6cd473c3ba1c369aee8fec9a
drm/amdkfd: Ensure user queue buffers residency

Add atomic queue_refcount to struct bo_va, return -EBUSY to fail unmap
BO from the GPU if the bo_va queue_refcount is not zero.

Create queue to increase the bo_va queue_refcount, destroy queue to
decrease the bo_va queue_refcount, to ensure the queue buffers mapped on
the GPU when queue is active.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_queue.c