aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@amd.com>2014-12-07 15:27:24 -0500
committerOded Gabbay <oded.gabbay@amd.com>2014-12-07 15:27:24 -0500
commitb6ffbab813cfc535db5c3815b4eb16dd7d97197c (patch)
treea9d299920bba937a3d288a88209720205b0775b7
parentb7392d2247cfe6771f95d256374f1a8e6a6f48d6 (diff)
amdkfd: Fix accounting of device queues
This patch fixes a device QCM bug, where the number of queues were not counted correctly for the operation of update queue. The count was incorrect as there was no regard to the previous state of the queue. Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c13
1 files changed, 11 insertions, 2 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 924e90c072e5..f44d6737b65a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -320,6 +320,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
320{ 320{
321 int retval; 321 int retval;
322 struct mqd_manager *mqd; 322 struct mqd_manager *mqd;
323 bool prev_active = false;
323 324
324 BUG_ON(!dqm || !q || !q->mqd); 325 BUG_ON(!dqm || !q || !q->mqd);
325 326
@@ -330,10 +331,18 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
330 return -ENOMEM; 331 return -ENOMEM;
331 } 332 }
332 333
333 retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
334 if (q->properties.is_active == true) 334 if (q->properties.is_active == true)
335 prev_active = true;
336
337 /*
338 *
339 * check active state vs. the previous state
340 * and modify counter accordingly
341 */
342 retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
343 if ((q->properties.is_active == true) && (prev_active == false))
335 dqm->queue_count++; 344 dqm->queue_count++;
336 else 345 else if ((q->properties.is_active == false) && (prev_active == true))
337 dqm->queue_count--; 346 dqm->queue_count--;
338 347
339 if (sched_policy != KFD_SCHED_POLICY_NO_HWS) 348 if (sched_policy != KFD_SCHED_POLICY_NO_HWS)