]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
amdkfd: find_process_by_mm always return the primary context
authorZhu Lingshan <lingshan.zhu@amd.com>
Tue, 29 Oct 2024 08:46:34 +0000 (16:46 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Dec 2025 18:56:40 +0000 (13:56 -0500)
Up until this commit, the kfd multiple contexts feature has
not been fully implemented in mainline kernel yet.

For backawrd compatibility, not break existing use cases,
this commit changes function find_process_by_mm, let it
always return the primary kfd_process.

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 307cf4ccc2a3bdfb9553ddaa75a7ad5131ef1a8e..1abcabc054a58757750f0833e9ebd812c1af98d0 100644 (file)
@@ -935,7 +935,7 @@ static struct kfd_process *find_process_by_mm(const struct mm_struct *mm)
 
        hash_for_each_possible_rcu(kfd_processes_table, process,
                                        kfd_processes, (uintptr_t)mm)
-               if (process->mm == mm)
+               if (process->mm == mm && process->context_id == KFD_CONTEXT_ID_PRIMARY)
                        return process;
 
        return NULL;