Skip to content

Commit

Permalink
drm/amdkfd: Limit queue number per process and device to 127
Browse files Browse the repository at this point in the history
HWS uses bit 7 in the queue number of the map process packet for an
undocumented feature. Therefore the queue number per process and
device must be 127 or less.

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
Felix Kuehling authored and Oded Gabbay committed Sep 27, 2017
1 parent bc920fd commit 36c2d7e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
struct process_queue_node *pqn;
struct kernel_queue *kq;
enum kfd_queue_type type = properties->type;
unsigned int max_queues = 127; /* HWS limit */

q = NULL;
kq = NULL;
Expand All @@ -166,10 +167,11 @@ int pqm_create_queue(struct process_queue_manager *pqm,
* If we are just about to create DIQ, the is_debug flag is not set yet
* Hence we also check the type as well
*/
if ((pdd->qpd.is_debug) || (type == KFD_QUEUE_TYPE_DIQ)) {
if (pdd->qpd.queue_count >= dev->device_info->max_no_of_hqd/2)
return -ENOSPC;
}
if ((pdd->qpd.is_debug) || (type == KFD_QUEUE_TYPE_DIQ))
max_queues = dev->device_info->max_no_of_hqd/2;

if (pdd->qpd.queue_count >= max_queues)
return -ENOSPC;

retval = find_available_queue_slot(pqm, qid);
if (retval != 0)
Expand Down

0 comments on commit 36c2d7e

Please sign in to comment.