I've long ago stopped trying to fully understand all the locking in amdkfd, so maybe this is safe for a contrived reason. It's definitely not how this should be done. Considers this more a request for a proper patch.
Cc: Felix Kuehling <felix.kuehl...@amd.com> Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Simona Vetter <simona.vet...@intel.com> Signed-off-by: Simona Vetter <simona.vet...@ffwll.ch> --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 260165bbe373..aa51930a012b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -1774,6 +1774,8 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu( ret = drm_gem_handle_create(adev->kfd.client.file, gobj, &(*mem)->gem_handle); if (ret) goto err_gem_handle_create; + /* FIXME: Thou shall completely initialize the bo before calling + * drm_gem_handle_create. Or explain why this is safe. */ bo = gem_to_amdgpu_bo(gobj); if (bo_type == ttm_bo_type_sg) { bo->tbo.sg = sg; -- 2.49.0