Skip to content

Commit 40318a2

Browse files
committed
drm/amdgpu/gfx12: set UNORD_DISPATCH in compute MQDs
This needs to be set to 1 to avoid a potential deadlock in the GC 10.x and newer. On GC 9.x and older, this needs to be set to 0. This can lead to hangs in some mixed graphics and compute workloads. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3575 Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b05d647 commit 40318a2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3054,7 +3054,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
30543054
(order_base_2(prop->queue_size / 4) - 1));
30553055
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, RPTR_BLOCK_SIZE,
30563056
(order_base_2(AMDGPU_GPU_PAGE_SIZE / 4) - 1));
3057-
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 0);
3057+
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, UNORD_DISPATCH, 1);
30583058
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, TUNNEL_DISPATCH, 0);
30593059
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, PRIV_STATE, 1);
30603060
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_CONTROL, KMD_QUEUE, 1);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd,
187187
m->cp_hqd_pq_control = 5 << CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT;
188188
m->cp_hqd_pq_control |=
189189
ffs(q->queue_size / sizeof(unsigned int)) - 1 - 1;
190+
m->cp_hqd_pq_control |= CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK;
190191
pr_debug("cp_hqd_pq_control 0x%x\n", m->cp_hqd_pq_control);
191192

192193
m->cp_hqd_pq_base_lo = lower_32_bits((uint64_t)q->queue_address >> 8);

0 commit comments

Comments
 (0)