Skip to content

Commit 2036b34

Browse files
amd-zhluoalexdeucher
authored andcommitted
drm/amdgpu: port SRIOV VF missed changes
port SRIOV VF missed changes from gfx_v9_0 to gfx_v9_4_3. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Zhigang Luo <Zhigang.Luo@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 5c6d52f commit 2036b34

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,8 @@ static int gfx_v9_4_3_xcc_kiq_init_queue(struct amdgpu_ring *ring, int xcc_id)
17621762
((struct v9_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF;
17631763
((struct v9_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF;
17641764
mutex_lock(&adev->srbm_mutex);
1765+
if (amdgpu_sriov_vf(adev) && adev->in_suspend)
1766+
amdgpu_ring_clear_ring(ring);
17651767
soc15_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0, GET_INST(GC, xcc_id));
17661768
gfx_v9_4_3_xcc_mqd_init(ring, xcc_id);
17671769
gfx_v9_4_3_xcc_kiq_init_register(ring, xcc_id);
@@ -1960,6 +1962,16 @@ static void gfx_v9_4_3_xcc_fini(struct amdgpu_device *adev, int xcc_id)
19601962
if (amdgpu_gfx_disable_kcq(adev, xcc_id))
19611963
DRM_ERROR("XCD %d KCQ disable failed\n", xcc_id);
19621964

1965+
if (amdgpu_sriov_vf(adev)) {
1966+
/* must disable polling for SRIOV when hw finished, otherwise
1967+
* CPC engine may still keep fetching WB address which is already
1968+
* invalid after sw finished and trigger DMAR reading error in
1969+
* hypervisor side.
1970+
*/
1971+
WREG32_FIELD15_PREREG(GC, GET_INST(GC, xcc_id), CP_PQ_WPTR_POLL_CNTL, EN, 0);
1972+
return;
1973+
}
1974+
19631975
/* Use deinitialize sequence from CAIL when unbinding device
19641976
* from driver, otherwise KIQ is hanging when binding back
19651977
*/
@@ -1984,7 +1996,8 @@ static int gfx_v9_4_3_hw_init(void *handle)
19841996
int r;
19851997
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
19861998

1987-
gfx_v9_4_3_init_golden_registers(adev);
1999+
if (!amdgpu_sriov_vf(adev))
2000+
gfx_v9_4_3_init_golden_registers(adev);
19882001

19892002
gfx_v9_4_3_constants_init(adev);
19902003

0 commit comments

Comments
 (0)