[PATCH] drm/amdgpu: reset psp ring wptr during ring_create

Chen, Horace Horace.Chen at amd.com
Thu Jun 10 07:28:41 UTC 2021

[AMD Official Use Only]

Reviewed-by: Horace Chen <horace.chen at amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of YuBiao Wang
Sent: Wednesday, June 9, 2021 11:02 AM
To: amd-gfx at lists.freedesktop.org
Cc: Wang, YuBiao <YuBiao.Wang at amd.com>; Grodzovsky, Andrey <Andrey.Grodzovsky at amd.com>; Xiao, Jack <Jack.Xiao at amd.com>; Xu, Feifei <Feifei.Xu at amd.com>; Chen, Horace <Horace.Chen at amd.com>; Wang, Kevin(Yang) <Kevin1.Wang at amd.com>; Xiaojie Yuan <xiaojie.yuan at amd.com>; Tuikov, Luben <Luben.Tuikov at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Quan, Evan <Evan.Quan at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>; Liu, Monk <Monk.Liu at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: [PATCH] drm/amdgpu: reset psp ring wptr during ring_create

psp ring wptr is not initialized properly in ring_create, which would lead to psp failure after several gpu reset.

Set ring_wptr to zero in psp_ring_create.

Signed-off-by: YuBiao Wang <YuBiao.Wang at amd.com>
 drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 1 +  drivers/gpu/drm/amd/amdgpu/psp_v3_1.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 0fd1ed918627..3e6218799a0c 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -468,6 +468,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"); diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
index 908664a5774b..be05d9cbd41e 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
@@ -231,6 +231,7 @@ static int psp_v3_1_ring_create(struct psp_context *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");

amd-gfx mailing list
amd-gfx at lists.freedesktop.org

More information about the amd-gfx mailing list