Skip to content

Commit ee98fb7

Browse files
Zhigang Luoalexdeucher
authored andcommitted
drm/amdgpu: set CP_HQD_PQ_DOORBELL_CONTROL.DOORBELL_MODE to 1
to avoid reading wrong WPTR from doorbell in sriov vf, set CP_HQD_PQ_DOORBELL_CONTROL.DOORBELL_MODE to 1 to read WPTR from MQD. Signed-off-by: Zhigang Luo <[email protected]> Acked-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 9e4c9ee commit ee98fb7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,9 @@ static int gfx_v9_4_3_xcc_mqd_init(struct amdgpu_ring *ring, int xcc_id)
16131613
DOORBELL_SOURCE, 0);
16141614
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
16151615
DOORBELL_HIT, 0);
1616+
if (amdgpu_sriov_vf(adev))
1617+
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
1618+
DOORBELL_MODE, 1);
16161619
} else {
16171620
tmp = REG_SET_FIELD(tmp, CP_HQD_PQ_DOORBELL_CONTROL,
16181621
DOORBELL_EN, 0);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ static void init_mqd_hiq_v9_4_3(struct mqd_manager *mm, void **mqd,
546546
m->cp_hqd_pq_control |= CP_HQD_PQ_CONTROL__NO_UPDATE_RPTR_MASK |
547547
1 << CP_HQD_PQ_CONTROL__PRIV_STATE__SHIFT |
548548
1 << CP_HQD_PQ_CONTROL__KMD_QUEUE__SHIFT;
549+
if (amdgpu_sriov_vf(mm->dev->adev))
550+
m->cp_hqd_pq_doorbell_control |= 1 <<
551+
CP_HQD_PQ_DOORBELL_CONTROL__DOORBELL_MODE__SHIFT;
549552
m->cp_mqd_stride_size = kfd_hiq_mqd_stride(mm->dev);
550553
if (xcc == 0) {
551554
/* Set no_update_rptr = 0 in Master XCC */

0 commit comments

Comments
 (0)