]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amdkfd: Check if there are kfd porcesses using adev by kfd_processes_count
authorXiaogang Chen <xiaogang.chen@amd.com>
Fri, 24 Apr 2026 18:47:01 +0000 (13:47 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 May 2026 13:56:51 +0000 (09:56 -0400)
commitd12d05c4bc4c15585130af43e897923ff292df7b
tree78418c4177cacce278fbc087dafd8e0819d8ce45
parent9e32d17592950478baffaecdbda8e2e60935fd3d
drm/amdkfd: Check if there are kfd porcesses using adev by kfd_processes_count

During gpu hot-unplug need check if there are kfd porcesses still using the
being removed gpu before clean resources of the device. Current driver checks
if kfd_processes_table is empty. kfd processes are not terminated after
removed from kfd_processes_table immediately. They are still alive and may
access the device until kfd_process_wq work queue got ran.

Check kfd->kfd_processes_count value that is updated after kfd process got
uninitialized when its ref becomes zero.

Fixes: 6cca686dfce7 ("drm/amdkfd: kfd driver supports hot unplug/replug amdgpu devices")
Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device.c