]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd: Clean up kfd node on surprise disconnect
authorMario Limonciello (AMD) <superm1@kernel.org>
Wed, 7 Jan 2026 21:37:28 +0000 (15:37 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2026 09:27:28 +0000 (10:27 +0100)
commita4218ac0bb8e70f7c0896f9df464baf2d5171ee6
tree23b858f97d9a98a4163d2d907ad638d70f5c9090
parentd9a82256a4c7e1e2b97bda11008b84a655bc225f
drm/amd: Clean up kfd node on surprise disconnect

commit 28695ca09d326461f8078332aa01db516983e8a2 upstream.

When an eGPU is unplugged the KFD topology should also be destroyed
for that GPU. This never happens because the fini_sw callbacks never
get to run. Run them manually before calling amdgpu_device_ip_fini_early()
when a device has already been disconnected.

This location is intentionally chosen to make sure that the kfd locking
refcount doesn't get incremented unintentionally.

Cc: kent.russell@amd.com
Closes: https://community.frame.work/t/amd-egpu-on-linux/8691/33
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6a23e7b4332c10f8b56c33a9c5431b52ecff9aab)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c