aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2017-11-01 19:21:33 -0400
committerOded Gabbay <oded.gabbay@gmail.com>2017-11-01 19:21:33 -0400
commit894a8293aaa702a5aef758bc069162a671ca7a07 (patch)
treee3939413fd043de1be3031655be133b7b790c3cf
parent096d1a3efc8b0914a4cfb1203c147ed597907191 (diff)
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>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c10
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_priv.h2
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_process.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index e2fc4c5d42cd..e202921c150e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -389,12 +389,11 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
389 if (sched_policy != KFD_SCHED_POLICY_NO_HWS) { 389 if (sched_policy != KFD_SCHED_POLICY_NO_HWS) {
390 retval = unmap_queues_cpsch(dqm, 390 retval = unmap_queues_cpsch(dqm,
391 KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0); 391 KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
392 if (retval != 0) { 392 if (retval) {
393 pr_err("unmap queue failed\n"); 393 pr_err("unmap queue failed\n");
394 goto out_unlock; 394 goto out_unlock;
395 } 395 }
396 } else if (sched_policy == KFD_SCHED_POLICY_NO_HWS && 396 } else if (prev_active &&
397 prev_active &&
398 (q->properties.type == KFD_QUEUE_TYPE_COMPUTE || 397 (q->properties.type == KFD_QUEUE_TYPE_COMPUTE ||
399 q->properties.type == KFD_QUEUE_TYPE_SDMA)) { 398 q->properties.type == KFD_QUEUE_TYPE_SDMA)) {
400 retval = mqd->destroy_mqd(mqd, q->mqd, 399 retval = mqd->destroy_mqd(mqd, q->mqd,
@@ -421,8 +420,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
421 420
422 if (sched_policy != KFD_SCHED_POLICY_NO_HWS) 421 if (sched_policy != KFD_SCHED_POLICY_NO_HWS)
423 retval = map_queues_cpsch(dqm); 422 retval = map_queues_cpsch(dqm);
424 else if (sched_policy == KFD_SCHED_POLICY_NO_HWS && 423 else if (q->properties.is_active &&
425 q->properties.is_active &&
426 (q->properties.type == KFD_QUEUE_TYPE_COMPUTE || 424 (q->properties.type == KFD_QUEUE_TYPE_COMPUTE ||
427 q->properties.type == KFD_QUEUE_TYPE_SDMA)) 425 q->properties.type == KFD_QUEUE_TYPE_SDMA))
428 retval = mqd->load_mqd(mqd, q->mqd, q->pipe, q->queue, 426 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,
832 830
833 if (q->properties.type == KFD_QUEUE_TYPE_SDMA) { 831 if (q->properties.type == KFD_QUEUE_TYPE_SDMA) {
834 retval = allocate_sdma_queue(dqm, &q->sdma_id); 832 retval = allocate_sdma_queue(dqm, &q->sdma_id);
835 if (retval != 0) 833 if (retval)
836 goto out; 834 goto out;
837 q->properties.sdma_queue_id = 835 q->properties.sdma_queue_id =
838 q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE; 836 q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 78b5d61780cb..9e4134c5b481 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -507,6 +507,8 @@ struct kfd_process {
507 * In any process, the thread that started main() is the lead 507 * In any process, the thread that started main() is the lead
508 * thread and outlives the rest. 508 * thread and outlives the rest.
509 * It is here because amd_iommu_bind_pasid wants a task_struct. 509 * It is here because amd_iommu_bind_pasid wants a task_struct.
510 * It can also be used for safely getting a reference to the
511 * mm_struct of the process.
510 */ 512 */
511 struct task_struct *lead_thread; 513 struct task_struct *lead_thread;
512 514
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index db08f8f53d4b..1f5ccd28bd41 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -416,7 +416,7 @@ int kfd_bind_processes_to_device(struct kfd_dev *dev)
416 err = amd_iommu_bind_pasid(dev->pdev, p->pasid, 416 err = amd_iommu_bind_pasid(dev->pdev, p->pasid,
417 p->lead_thread); 417 p->lead_thread);
418 if (err < 0) { 418 if (err < 0) {
419 pr_err("unexpected pasid %d binding failure\n", 419 pr_err("Unexpected pasid %d binding failure\n",
420 p->pasid); 420 p->pasid);
421 mutex_unlock(&p->mutex); 421 mutex_unlock(&p->mutex);
422 break; 422 break;