]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
amdkfd: process pointer of a HIQ should be NULL
authorZhu Lingshan <lingshan.zhu@amd.com>
Mon, 4 Aug 2025 07:36:31 +0000 (15:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Dec 2025 18:56:42 +0000 (13:56 -0500)
In kq_initialize, queue->process of a HIQ should
be NULL as initialized, because it does not belong
to any kfd_process.

This commit decommisions the function kfd_get_process() because
it can not locate a specific kfd_process among multiple
contexts and not any code path calls it after this commit.

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_kernel_queue.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_process.c

index 7ce4531ec3bc79abe78fab0d60d617903a256456..19ea759568a602bf328c325ca69bad5addcddfb5 100644 (file)
@@ -129,7 +129,6 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev,
                goto err_init_queue;
 
        kq->queue->device = dev;
-       kq->queue->process = kfd_get_process(current);
 
        kq->queue->mqd_mem_obj = kq->mqd_mgr->allocate_mqd(kq->mqd_mgr->dev,
                                        &kq->queue->properties);
index 4cde21245cc8eaa9ae2371cef0f2cdef6dae2872..e424551d14b23eb7dbd645d36e6b3b53f431d060 100644 (file)
@@ -1058,7 +1058,6 @@ void kfd_process_destroy_wq(void);
 void kfd_cleanup_processes(void);
 struct kfd_process *kfd_create_process(struct task_struct *thread);
 int kfd_create_process_sysfs(struct kfd_process *process);
-struct kfd_process *kfd_get_process(const struct task_struct *task);
 struct kfd_process *kfd_lookup_process_by_pasid(u32 pasid,
                                                 struct kfd_process_device **pdd);
 struct kfd_process *kfd_lookup_process_by_mm(const struct mm_struct *mm);
index c3bbcb28390f48acca36e1ec7c7a2336b89f4952..06986f629b87274d735dc70dd1c16f60f4a7774b 100644 (file)
@@ -985,24 +985,6 @@ out:
        return process;
 }
 
-struct kfd_process *kfd_get_process(const struct task_struct *thread)
-{
-       struct kfd_process *process;
-
-       if (!thread->mm)
-               return ERR_PTR(-EINVAL);
-
-       /* Only the pthreads threading model is supported. */
-       if (thread->group_leader->mm != thread->mm)
-               return ERR_PTR(-EINVAL);
-
-       process = find_process(thread, false);
-       if (!process)
-               return ERR_PTR(-EINVAL);
-
-       return process;
-}
-
 static struct kfd_process *find_process_by_mm(const struct mm_struct *mm)
 {
        struct kfd_process *process;