]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: rework amdgpu_userq_signal_ioctl v3
authorChristian König <christian.koenig@amd.com>
Thu, 16 Apr 2026 13:32:11 +0000 (15:32 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 May 2026 20:08:31 +0000 (16:08 -0400)
commit1609eb0f81a609d350169839128cecf298c84e7a
tree2518a17a7dbea708c71ceea8312856e083cdaa53
parent359cf7b42f87acc1ddd6b974fabe0ed6722f97ff
drm/amdgpu: rework amdgpu_userq_signal_ioctl v3

This one was fortunately not looking so bad as the wait ioctl path, but
there were still a few things which could be fixed/improved:

1. Allocating with GFP_ATOMIC was quite unnecessary, we can do that
   before taking the userq_lock.
2. Use a new mutex as protection for the fence_drv_xa so that we can do
   memory allocations while holding it.
3. Starting the reset timer is unnecessary when the fence is already
   signaled when we create it.
4. Cleanup error handling, avoid trying to free the queue when we don't
   even got one.

v2: fix incorrect usage of xa_find, destroy the new mutex on error
v3: cleanup ref ordering

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c