drm/amdkfd: don't always call execute_queues_cpsch()
authorYong Zhao <yong.zhao@amd.com>
Tue, 2 Jan 2018 18:10:50 +0000 (13:10 -0500)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 2 Jan 2018 18:10:50 +0000 (13:10 -0500)
When destroying an inactive queue, we don't need to call
execute_queues_cpsch.

Signed-off-by: Yong Zhao <yong.zhao@amd.com>
Reviewed-by: Oak Zeng <oak.zeng@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

index acfb12100e177fc30e3a394cd03302b4d44060ce..b21285afa4eac19f243ba1c22b3a486e1828eeae 100644 (file)
@@ -1013,13 +1013,13 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,
 
        list_del(&q->list);
        qpd->queue_count--;
-       if (q->properties.is_active)
+       if (q->properties.is_active) {
                dqm->queue_count--;
-
-       retval = execute_queues_cpsch(dqm,
+               retval = execute_queues_cpsch(dqm,
                                KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
-       if (retval == -ETIME)
-               qpd->reset_wavefronts = true;
+               if (retval == -ETIME)
+                       qpd->reset_wavefronts = true;
+       }
 
        mqd->uninit_mqd(mqd, q->mqd, q->mqd_mem_obj);