drm/amdgpu: reset psp ring wptr during ring_create
authorYuBiao Wang <YuBiao.Wang@amd.com>
Wed, 9 Jun 2021 02:41:34 +0000 (10:41 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 11 Jun 2021 20:03:26 +0000 (16:03 -0400)
[Why]
psp ring wptr is not initialized properly in ring_create,
which would lead to psp failure after several gpu reset.

[How]
Set ring_wptr to zero in psp_ring_create.

Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>
Reviewed-by: Horace Chen <horace.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c

index fc400d9..bc133db 100644 (file)
@@ -461,6 +461,7 @@ static int psp_v11_0_ring_create(struct psp_context *psp,
        struct amdgpu_device *adev = psp->adev;
 
        if (amdgpu_sriov_vf(adev)) {
+               ring->ring_wptr = 0;
                ret = psp_v11_0_ring_stop(psp, ring_type);
                if (ret) {
                        DRM_ERROR("psp_v11_0_ring_stop_sriov failed!\n");
index ce7377d..b86dcba 100644 (file)
@@ -227,6 +227,7 @@ static int psp_v3_1_ring_create(struct psp_context *psp,
        psp_v3_1_reroute_ih(psp);
 
        if (amdgpu_sriov_vf(adev)) {
+               ring->ring_wptr = 0;
                ret = psp_v3_1_ring_stop(psp, ring_type);
                if (ret) {
                        DRM_ERROR("psp_v3_1_ring_stop_sriov failed!\n");