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 <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> --- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 1 - drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 - drivers/gpu/drm/amd/amdkfd/kfd_process.c | 18 ------------------ 3 files changed, 20 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c index 7ce4531ec3bc..19ea759568a6 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c @@ -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); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index 71c0cefb87ea..42b6492d7682 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -1060,7 +1060,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); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 157145c94314..35a9e91650ca 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -985,24 +985,6 @@ struct kfd_process *kfd_create_process(struct task_struct *thread) 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; -- 2.51.0
