drm/amdkfd: Minor cleanups

These were missed previously when rebasing changes for upstreaming.

v2: Remove redundant sched_policy conditions

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
This commit is contained in:
Felix Kuehling 2017-11-01 19:21:33 -04:00 committed by Oded Gabbay
parent 096d1a3efc
commit 894a8293aa
3 changed files with 7 additions and 7 deletions

View File

@ -389,12 +389,11 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
if (sched_policy != KFD_SCHED_POLICY_NO_HWS) { if (sched_policy != KFD_SCHED_POLICY_NO_HWS) {
retval = unmap_queues_cpsch(dqm, retval = unmap_queues_cpsch(dqm,
KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0); KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
if (retval != 0) { if (retval) {
pr_err("unmap queue failed\n"); pr_err("unmap queue failed\n");
goto out_unlock; goto out_unlock;
} }
} else if (sched_policy == KFD_SCHED_POLICY_NO_HWS && } else if (prev_active &&
prev_active &&
(q->properties.type == KFD_QUEUE_TYPE_COMPUTE || (q->properties.type == KFD_QUEUE_TYPE_COMPUTE ||
q->properties.type == KFD_QUEUE_TYPE_SDMA)) { q->properties.type == KFD_QUEUE_TYPE_SDMA)) {
retval = mqd->destroy_mqd(mqd, q->mqd, retval = mqd->destroy_mqd(mqd, q->mqd,
@ -421,8 +420,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
if (sched_policy != KFD_SCHED_POLICY_NO_HWS) if (sched_policy != KFD_SCHED_POLICY_NO_HWS)
retval = map_queues_cpsch(dqm); retval = map_queues_cpsch(dqm);
else if (sched_policy == KFD_SCHED_POLICY_NO_HWS && else if (q->properties.is_active &&
q->properties.is_active &&
(q->properties.type == KFD_QUEUE_TYPE_COMPUTE || (q->properties.type == KFD_QUEUE_TYPE_COMPUTE ||
q->properties.type == KFD_QUEUE_TYPE_SDMA)) q->properties.type == KFD_QUEUE_TYPE_SDMA))
retval = mqd->load_mqd(mqd, q->mqd, q->pipe, q->queue, retval = mqd->load_mqd(mqd, q->mqd, q->pipe, q->queue,
@ -832,7 +830,7 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
if (q->properties.type == KFD_QUEUE_TYPE_SDMA) { if (q->properties.type == KFD_QUEUE_TYPE_SDMA) {
retval = allocate_sdma_queue(dqm, &q->sdma_id); retval = allocate_sdma_queue(dqm, &q->sdma_id);
if (retval != 0) if (retval)
goto out; goto out;
q->properties.sdma_queue_id = q->properties.sdma_queue_id =
q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE; q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE;

View File

@ -507,6 +507,8 @@ struct kfd_process {
* In any process, the thread that started main() is the lead * In any process, the thread that started main() is the lead
* thread and outlives the rest. * thread and outlives the rest.
* It is here because amd_iommu_bind_pasid wants a task_struct. * It is here because amd_iommu_bind_pasid wants a task_struct.
* It can also be used for safely getting a reference to the
* mm_struct of the process.
*/ */
struct task_struct *lead_thread; struct task_struct *lead_thread;

View File

@ -416,7 +416,7 @@ int kfd_bind_processes_to_device(struct kfd_dev *dev)
err = amd_iommu_bind_pasid(dev->pdev, p->pasid, err = amd_iommu_bind_pasid(dev->pdev, p->pasid,
p->lead_thread); p->lead_thread);
if (err < 0) { if (err < 0) {
pr_err("unexpected pasid %d binding failure\n", pr_err("Unexpected pasid %d binding failure\n",
p->pasid); p->pasid);
mutex_unlock(&p->mutex); mutex_unlock(&p->mutex);
break; break;