Skip to contentSkip to conversation

drm/amdgpu: Fix S3 test issue

PATCH In review Zhu, James 2 participants 2 messages May 8, 2019 – May 9, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Zhu, James

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix S3 test issue

During S3 test, when system wake up and resume, ras interface is already allocated. Move workaround before ras jumps to resume step in gfx_v9_0_ecc_late_init, and make sure workaround applied during resume. Also remove unused mmGB_EDC_MODE clearing.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +5 -9
index 14e671d..34a01f2 100644
@@ -3630,7 +3630,6 @@ static int gfx_v9_0_do_edc_gpr_workarounds(struct amdgpu_device *adev)
 	struct amdgpu_ib ib;
 	struct dma_fence *f = NULL;
 	int r, i, j;
-	u32 tmp;
 	unsigned total_size, vgpr_offset, sgpr_offset;
 	u64 gpu_addr;
 
@@ -3642,9 +3641,6 @@ static int gfx_v9_0_do_edc_gpr_workarounds(struct amdgpu_device *adev)
 	if (!ring->sched.ready)
 		return 0;
 
-	tmp = RREG32_SOC15(GC, 0, mmGB_EDC_MODE);
-	WREG32_SOC15(GC, 0, mmGB_EDC_MODE, 0);
-
 	total_size =
 		((ARRAY_SIZE(vgpr_init_regs) * 3) + 4 + 5 + 2) * 4;
 	total_size +=
@@ -3810,6 +3806,11 @@ static int gfx_v9_0_ecc_late_init(void *handle)
 		return 0;
 	}
 
+	/* requires IBs so do in late init after IB pool is initialized */
+	r = gfx_v9_0_do_edc_gpr_workarounds(adev);
+	if (r)
+		return r;
+
 	if (*ras_if)
 		goto resume;
 
@@ -3817,11 +3818,6 @@ static int gfx_v9_0_ecc_late_init(void *handle)
 	if (!*ras_if)
 		return -ENOMEM;
 
-	/* requires IBs so do in late init after IB pool is initialized */
-	r = gfx_v9_0_do_edc_gpr_workarounds(adev);
-	if (r)
-		return r;
-
 	**ras_if = ras_block;
 
 	r = amdgpu_ras_feature_enable_on_boot(adev, *ras_if, 1);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1557348409-18026-1-git-send-email-James.Zhu-5C7GfCeVMHo@public.gmane.org

Acked-by
#2 lore raw
Quoted 7 lines · James

During S3 test, when system wake up and resume, ras interface is already allocated. Move workaround before ras jumps to resume step in gfx_v9_0_ecc_late_init, and make sure workaround applied during resume. Also remove unused mmGB_EDC_MODE clearing.

Quoted 53 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +5 -10
index 14e671d..34a01f2 100644
@@ -3630,7 +3630,6 @@ static int gfx_v9_0_do_edc_gpr_workarounds(struct amdgpu_device *adev)
        struct amdgpu_ib ib;
        struct dma_fence *f = NULL;
        int r, i, j;
-       u32 tmp;
        unsigned total_size, vgpr_offset, sgpr_offset;
        u64 gpu_addr;
 
@@ -3642,9 +3641,6 @@ static int gfx_v9_0_do_edc_gpr_workarounds(struct amdgpu_device *adev)
        if (!ring->sched.ready)
                return 0;
 
-       tmp = RREG32_SOC15(GC, 0, mmGB_EDC_MODE);
-       WREG32_SOC15(GC, 0, mmGB_EDC_MODE, 0);
-
        total_size =
                ((ARRAY_SIZE(vgpr_init_regs) * 3) + 4 + 5 + 2) * 4;
        total_size +=
@@ -3810,6 +3806,11 @@ static int gfx_v9_0_ecc_late_init(void *handle)
                return 0;
        }
 
+       /* requires IBs so do in late init after IB pool is initialized */
+       r = gfx_v9_0_do_edc_gpr_workarounds(adev);
+       if (r)
+               return r;
+
        if (*ras_if)
                goto resume;
 
@@ -3817,11 +3818,6 @@ static int gfx_v9_0_ecc_late_init(void *handle)
        if (!*ras_if)
                return -ENOMEM;
 
-       /* requires IBs so do in late init after IB pool is initialized */
-       r = gfx_v9_0_do_edc_gpr_workarounds(adev);
-       if (r)
-               return r;
-
        **ras_if = ras_block;
 
        r = amdgpu_ras_feature_enable_on_boot(adev, *ras_if, 1);
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx