aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c2
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_module.c4
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c6
3 files changed, 8 insertions, 4 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 0d8694f015c1..0fd592799d58 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -822,7 +822,7 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
822 * Unconditionally decrement this counter, regardless of the queue's 822 * Unconditionally decrement this counter, regardless of the queue's
823 * type. 823 * type.
824 */ 824 */
825 dqm->total_queue_count++; 825 dqm->total_queue_count--;
826 pr_debug("Total of %d queues are accountable so far\n", 826 pr_debug("Total of %d queues are accountable so far\n",
827 dqm->total_queue_count); 827 dqm->total_queue_count);
828 mutex_unlock(&dqm->lock); 828 mutex_unlock(&dqm->lock);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
index a8be6df85347..1c385c23dd0b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
@@ -95,10 +95,10 @@ static int __init kfd_module_init(void)
95 } 95 }
96 96
97 /* Verify module parameters */ 97 /* Verify module parameters */
98 if ((max_num_of_queues_per_device < 0) || 98 if ((max_num_of_queues_per_device < 1) ||
99 (max_num_of_queues_per_device > 99 (max_num_of_queues_per_device >
100 KFD_MAX_NUM_OF_QUEUES_PER_DEVICE)) { 100 KFD_MAX_NUM_OF_QUEUES_PER_DEVICE)) {
101 pr_err("kfd: max_num_of_queues_per_device must be between 0 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n"); 101 pr_err("kfd: max_num_of_queues_per_device must be between 1 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n");
102 return -1; 102 return -1;
103 } 103 }
104 104
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index f37cf5efe642..2fda1927bff7 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -315,7 +315,11 @@ int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid,
315 BUG_ON(!pqm); 315 BUG_ON(!pqm);
316 316
317 pqn = get_queue_by_qid(pqm, qid); 317 pqn = get_queue_by_qid(pqm, qid);
318 BUG_ON(!pqn); 318 if (!pqn) {
319 pr_debug("amdkfd: No queue %d exists for update operation\n",
320 qid);
321 return -EFAULT;
322 }
319 323
320 pqn->q->properties.queue_address = p->queue_address; 324 pqn->q->properties.queue_address = p->queue_address;
321 pqn->q->properties.queue_size = p->queue_size; 325 pqn->q->properties.queue_size = p->queue_size;