Skip to content

Commit 36e7ff5

Browse files
Tim Huangalexdeucher
authored andcommitted
drm/amdgpu: fix GRBM read timeout when do mes_self_test
Use a proper MEID to make sure the CP_HQD_* and CP_GFX_HQD_* registers can be touched when initialize the compute and gfx mqd in mes_self_test. Otherwise, we expect no response from CP and an GRBM eventual timeout. Signed-off-by: Tim Huang <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Yifan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 18eae36 commit 36e7ff5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,20 @@ static void amdgpu_mes_queue_init_mqd(struct amdgpu_device *adev,
557557
mqd_prop.hqd_queue_priority = p->hqd_queue_priority;
558558
mqd_prop.hqd_active = false;
559559

560+
if (p->queue_type == AMDGPU_RING_TYPE_GFX ||
561+
p->queue_type == AMDGPU_RING_TYPE_COMPUTE) {
562+
mutex_lock(&adev->srbm_mutex);
563+
amdgpu_gfx_select_me_pipe_q(adev, p->ring->me, p->ring->pipe, 0, 0, 0);
564+
}
565+
560566
mqd_mgr->init_mqd(adev, q->mqd_cpu_ptr, &mqd_prop);
561567

568+
if (p->queue_type == AMDGPU_RING_TYPE_GFX ||
569+
p->queue_type == AMDGPU_RING_TYPE_COMPUTE) {
570+
amdgpu_gfx_select_me_pipe_q(adev, 0, 0, 0, 0, 0);
571+
mutex_unlock(&adev->srbm_mutex);
572+
}
573+
562574
amdgpu_bo_unreserve(q->mqd_obj);
563575
}
564576

@@ -994,9 +1006,13 @@ int amdgpu_mes_add_ring(struct amdgpu_device *adev, int gang_id,
9941006
switch (queue_type) {
9951007
case AMDGPU_RING_TYPE_GFX:
9961008
ring->funcs = adev->gfx.gfx_ring[0].funcs;
1009+
ring->me = adev->gfx.gfx_ring[0].me;
1010+
ring->pipe = adev->gfx.gfx_ring[0].pipe;
9971011
break;
9981012
case AMDGPU_RING_TYPE_COMPUTE:
9991013
ring->funcs = adev->gfx.compute_ring[0].funcs;
1014+
ring->me = adev->gfx.compute_ring[0].me;
1015+
ring->pipe = adev->gfx.compute_ring[0].pipe;
10001016
break;
10011017
case AMDGPU_RING_TYPE_SDMA:
10021018
ring->funcs = adev->sdma.instance[0].ring.funcs;

0 commit comments

Comments
 (0)