Skip to content

Commit

Permalink
drm/amdkfd: Fix dqm->queue_count tracking
Browse files Browse the repository at this point in the history
dqm->queue_count tracks queues in the active state only. In a few
places this count is modified unconditionally, leading to an incorrect
value when the UPDATE_QUEUE ioctl is used to make a queue inactive.

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Reviewed-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
  • Loading branch information
Jay Cornwall authored and Oded Gabbay committed Jan 19, 2015
1 parent e4bf44b commit b6819ce
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
}

list_add(&q->list, &qpd->queues_list);
dqm->queue_count++;
if (q->properties.is_active)
dqm->queue_count++;

if (q->properties.type == KFD_QUEUE_TYPE_SDMA)
dqm->sdma_queue_count++;
Expand Down Expand Up @@ -313,7 +314,8 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm,
list_del(&q->list);
if (list_empty(&qpd->queues_list))
deallocate_vmid(dqm, qpd, q);
dqm->queue_count--;
if (q->properties.is_active)
dqm->queue_count--;

/*
* Unconditionally decrement this counter, regardless of the queue's
Expand Down Expand Up @@ -1018,7 +1020,8 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,
dqm->sdma_queue_count--;

list_del(&q->list);
dqm->queue_count--;
if (q->properties.is_active)
dqm->queue_count--;

execute_queues_cpsch(dqm, false);

Expand Down

0 comments on commit b6819ce

Please sign in to comment.