]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amdgpu/userq: make sure queue is valid in the hang_detect_work
authorSunil Khatri <sunil.khatri@amd.com>
Mon, 18 May 2026 14:28:08 +0000 (19:58 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 May 2026 15:58:31 +0000 (11:58 -0400)
commitcf4aafdccefccc7f8236fed028d06725246e289e
tree8022e148e5b6dad4fd6d9dcc3435a23e1c092952
parenta00caed2302c604c19a5cab781e34d7ba4fa7558
drm/amdgpu/userq: make sure queue is valid in the hang_detect_work

Thread 1: Running amdgpu_userq_destroy which eventually remove
the queue from door bell and set userq_mgr = NULL.

Thread2: An interrupt might have scheduled the hang_detect_work
which still need userq_mgr to be valid but could get an NULL
ptrs.

To fix that make sure we cancel the hang_detect_work again before
setting userq_mgr to NULL.

Along with that we also need all the queue va to remain valid till
we could be running anything on the queue and hence moving the
userq_va post hang_detect handler is cancelled.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1a66ceb98b137d18d303b9889f0e7d8c4db73943)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c