]> git.hungrycats.org Git - linux/commitdiff
amdkfd: properly free secondary context id
authorZhu Lingshan <lingshan.zhu@amd.com>
Wed, 1 Jul 2026 08:08:12 +0000 (16:08 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 8 Jul 2026 18:23:20 +0000 (14:23 -0400)
Function kfd_process_free_id() should skip over
the primary kfd process because its context id
is fixed assigned, not allocated through the ida table.
This function should only work on secondary contexts.

Fixes: fac682a1d1af ("amdkfd: identify a secondary kfd process by its id")
Signed-off-by: Zhu Lingshan <lingshan.zhu@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_process.c

index 7a604b8c8886252fff8425bc4a197c50a109dd46..da4257c9aae085692a655ce1986a582da37628f4 100644 (file)
@@ -948,7 +948,7 @@ static void kfd_process_free_id(struct kfd_process *process)
 {
        struct kfd_process *primary_process;
 
-       if (process->context_id != KFD_CONTEXT_ID_PRIMARY)
+       if (process->context_id == KFD_CONTEXT_ID_PRIMARY)
                return;
 
        primary_process = kfd_lookup_process_by_mm(process->lead_thread->mm);