]> 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 21:46:43 +0000 (17:46 -0400)
commit44e5bc73bdcbec115cfe1c4b4394d25eb3deaff2
tree35ccecd6c9f801b49bebba92636bdc407c9de3dd
parentd5971c5c34303a00bf841a902ca00a703602c500
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>
(cherry picked from commit 1609eb0f81a609d350169839128cecf298c84e7a)
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