Skip to contentSkip to conversation

drm/amdgpu: Stop clearing kiq position during fini

PATCH In review Yaoyao Lei 3 participants 3 messages Feb 27, 2023 – Mar 2, 2023

Subsystems (2)
lore
Share & tools
lore

Yaoyao Lei

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Stop clearing kiq position during fini

Do not clear kiq position in RLC_CP_SCHEDULER so that CP could perform IDLE-SAVE after VF fini.
Otherwise it could cause GFX hang if another Win guest is rendering.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -11
index 6983acc456b2..073f5f23bc3b 100644
@@ -7285,17 +7285,9 @@ static int gfx_v10_0_hw_fini(void *handle)
 
 	if (amdgpu_sriov_vf(adev)) {
 		gfx_v10_0_cp_gfx_enable(adev, false);
-		/* Program KIQ position of RLC_CP_SCHEDULERS during destroy */
-		if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 0)) {
-			tmp = RREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS_Sienna_Cichlid);
-			tmp &= 0xffffff00;
-			WREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS_Sienna_Cichlid, tmp);
-		} else {
-			tmp = RREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS);
-			tmp &= 0xffffff00;
-			WREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS, tmp);
-		}
-
+		/* Remove the steps of clearing KIQ position.
+		 * It causes GFX hang when another Win guest is rendering.
+		 */
 		return 0;
 	}
 	gfx_v10_0_cp_enable(adev, false);
Signature · 1 line
2.25.1
Acked-by ZhenGuo Yin on v1 1/1
#1 lore raw
Quoted 34 lines · Yaoyao Lei

Do not clear kiq position in RLC_CP_SCHEDULER so that CP could perform IDLE-SAVE after VF fini.
Otherwise it could cause GFX hang if another Win guest is rendering.

---
  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 14 +++-----------
  1 file changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -11
index 6983acc456b2..073f5f23bc3b 100644
@@ -7285,17 +7285,9 @@ static int gfx_v10_0_hw_fini(void *handle)
 
  	if (amdgpu_sriov_vf(adev)) {
  		gfx_v10_0_cp_gfx_enable(adev, false);
-		/* Program KIQ position of RLC_CP_SCHEDULERS during destroy */
-		if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 0)) {
-			tmp = RREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS_Sienna_Cichlid);
-			tmp &= 0xffffff00;
-			WREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS_Sienna_Cichlid, tmp);
-		} else {
-			tmp = RREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS);
-			tmp &= 0xffffff00;
-			WREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS, tmp);
-		}
-
+		/* Remove the steps of clearing KIQ position.
+		 * It causes GFX hang when another Win guest is rendering.
+		 */
  		return 0;
  	}
  	gfx_v10_0_cp_enable(adev, false);
#2 lore raw
In reply to Yaoyao Lei

[AMD Official Use Only - General]

After the patch merge, the "tmp" variable will not be used, and a compilation warning will be generated.

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yaoyao Lei
Sent: Monday, February 27, 2023 2:46 PM
To: [email protected]
Cc: Lei, YaoYao <[email protected]>
Subject: [PATCH] drm/amdgpu: Stop clearing kiq position during fini

Do not clear kiq position in RLC_CP_SCHEDULER so that CP could perform IDLE-SAVE after VF fini. Otherwise it could cause GFX hang if another Win guest is rendering.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -11
index 6983acc456b2..073f5f23bc3b 100644
@@ -7285,17 +7285,9 @@ static int gfx_v10_0_hw_fini(void *handle)
 
        if (amdgpu_sriov_vf(adev)) {
                gfx_v10_0_cp_gfx_enable(adev, false);
-               /* Program KIQ position of RLC_CP_SCHEDULERS during destroy */
-               if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 0)) {
-                       tmp = RREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS_Sienna_Cichlid);
-                       tmp &= 0xffffff00;
-                       WREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS_Sienna_Cichlid, tmp);
-               } else {
-                       tmp = RREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS);
-                       tmp &= 0xffffff00;
-                       WREG32_SOC15(GC, 0, mmRLC_CP_SCHEDULERS, tmp);
-               }
-
+               /* Remove the steps of clearing KIQ position.
+                * It causes GFX hang when another Win guest is rendering.
+                */
                return 0;
        }
        gfx_v10_0_cp_enable(adev, false);

--
2.25.1