Skip to content

Commit 42ea9cf

Browse files
donettom-1alexdeucher
authored andcommitted
drm/amdkfd: Relax size checking during queue buffer get
HW-supported EOP buffer sizes are 4K and 32K. On systems that do not use 4K pages, the minimum buffer object (BO) allocation size is PAGE_SIZE (for example, 64K). During queue buffer acquisition, the driver currently checks the allocated BO size against the supported EOP buffer size. Since the allocated BO is larger than the expected size, this check fails, preventing queue creation. Relax the strict size validation and allow PAGE_SIZE-sized BOs to be used. Only the required 4K region of the buffer will be used as the EOP buffer and avoids queue creation failures on non-4K page systems. Acked-by: Christian König <christian.koenig@amd.com> Suggested-by: Philip Yang <yangp@amd.com> Signed-off-by: Donet Tom <donettom@linux.ibm.com> Signed-off-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 318b1c3 commit 42ea9cf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_queue.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,16 +278,16 @@ int kfd_queue_acquire_buffers(struct kfd_process_device *pdd, struct queue_prope
278278

279279
/* EOP buffer is not required for all ASICs */
280280
if (properties->eop_ring_buffer_address) {
281-
if (properties->eop_ring_buffer_size != topo_dev->node_props.eop_buffer_size) {
282-
pr_debug("queue eop bo size 0x%x not equal to node eop buf size 0x%x\n",
281+
if (properties->eop_ring_buffer_size < topo_dev->node_props.eop_buffer_size) {
282+
pr_debug("queue eop bo size 0x%x is less than node eop buf size 0x%x\n",
283283
properties->eop_ring_buffer_size,
284284
topo_dev->node_props.eop_buffer_size);
285285
err = -EINVAL;
286286
goto out_err_unreserve;
287287
}
288288
err = kfd_queue_buffer_get(vm, (void *)properties->eop_ring_buffer_address,
289289
&properties->eop_buf_bo,
290-
properties->eop_ring_buffer_size);
290+
ALIGN(properties->eop_ring_buffer_size, PAGE_SIZE));
291291
if (err)
292292
goto out_err_unreserve;
293293
}

0 commit comments

Comments
 (0)