Skip to content

Commit

Permalink
drm/amdkfd: Pass filter params to unmap_queues_cpsch
Browse files Browse the repository at this point in the history
Signed-off-by: Yong Zhao <yong.zhao@amd.com>
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>
  • Loading branch information
Yong Zhao authored and Oded Gabbay committed Oct 8, 2017
1 parent ac30c78 commit 4465f46
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ static int create_compute_queue_nocpsch(struct device_queue_manager *dqm,

static int execute_queues_cpsch(struct device_queue_manager *dqm);
static int unmap_queues_cpsch(struct device_queue_manager *dqm,
bool static_queues_included);
enum kfd_unmap_queues_filter filter,
uint32_t filter_param);

static int create_sdma_queue_nocpsch(struct device_queue_manager *dqm,
struct queue *q,
Expand Down Expand Up @@ -710,7 +711,7 @@ static int start_cpsch(struct device_queue_manager *dqm)
static int stop_cpsch(struct device_queue_manager *dqm)
{
mutex_lock(&dqm->lock);
unmap_queues_cpsch(dqm, true);
unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0);
mutex_unlock(&dqm->lock);

kfd_gtt_sa_free(dqm->dev, dqm->fence_mem);
Expand Down Expand Up @@ -754,7 +755,7 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
{
mutex_lock(&dqm->lock);
/* here we actually preempt the DIQ */
unmap_queues_cpsch(dqm, true);
unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0);
list_del(&kq->list);
dqm->queue_count--;
qpd->is_debug = false;
Expand Down Expand Up @@ -863,10 +864,10 @@ static int unmap_sdma_queues(struct device_queue_manager *dqm,

/* dqm->lock mutex has to be locked before calling this function */
static int unmap_queues_cpsch(struct device_queue_manager *dqm,
bool static_queues_included)
enum kfd_unmap_queues_filter filter,
uint32_t filter_param)
{
int retval;
enum kfd_unmap_queues_filter filter;
struct kfd_process_device *pdd;

retval = 0;
Expand All @@ -882,12 +883,8 @@ static int unmap_queues_cpsch(struct device_queue_manager *dqm,
unmap_sdma_queues(dqm, 1);
}

filter = static_queues_included ?
KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES :
KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES;

retval = pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_COMPUTE,
filter, 0, false, 0);
filter, filter_param, false, 0);
if (retval)
return retval;

Expand All @@ -914,7 +911,8 @@ static int execute_queues_cpsch(struct device_queue_manager *dqm)
{
int retval;

retval = unmap_queues_cpsch(dqm, false);
retval = unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES,
0);
if (retval) {
pr_err("The cp might be in an unrecoverable state due to an unsuccessful queues preemption");
return retval;
Expand Down

0 comments on commit 4465f46

Please sign in to comment.