Skip to contentSkip to conversation

drm/amdgpu: Skip TMR for MP0_HWIP 13.0.6

PATCH In review Zhigang Luo 2 participants 3 messages Jun 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: Skip TMR for MP0_HWIP 13.0.6

For SRIOV VF, no TMR needed.

Change-Id If9556cf60dfcbd95e102b1387cf233e902d9490e
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
index e15c27e05564..ac9b57231589 100644
@@ -839,6 +839,7 @@ static bool psp_skip_tmr(struct psp_context *psp)
 	case IP_VERSION(11, 0, 9):
 	case IP_VERSION(11, 0, 7):
 	case IP_VERSION(13, 0, 2):
+	case IP_VERSION(13, 0, 6):
 	case IP_VERSION(13, 0, 10):
 		return true;
 	default:
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 drm/amdgpu: port SRIOV VF missed changes

port SRIOV VF missed changes from gfx_v9_0 to gfx_v9_4_3.

Change-Id Id580820376c8d653e9ec5ebf5a8b950cd0a67e1a
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +14 -1
index c1ee54d4c3d3..76b189bd244a 100644
@@ -1762,6 +1762,8 @@ static int gfx_v9_4_3_xcc_kiq_init_queue(struct amdgpu_ring *ring, int xcc_id)
 		((struct v9_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF;
 		((struct v9_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF;
 		mutex_lock(&adev->srbm_mutex);
+		if (amdgpu_sriov_vf(adev) && adev->in_suspend)
+			amdgpu_ring_clear_ring(ring);
 		soc15_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0, GET_INST(GC, xcc_id));
 		gfx_v9_4_3_xcc_mqd_init(ring, xcc_id);
 		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)
 	if (amdgpu_gfx_disable_kcq(adev, xcc_id))
 		DRM_ERROR("XCD %d KCQ disable failed\n", xcc_id);
 
+	if (amdgpu_sriov_vf(adev)) {
+		/* must disable polling for SRIOV when hw finished, otherwise
+		 * CPC engine may still keep fetching WB address which is already
+		 * invalid after sw finished and trigger DMAR reading error in
+		 * hypervisor side.
+		 */
+		WREG32_FIELD15_PREREG(GC, GET_INST(GC, xcc_id), CP_PQ_WPTR_POLL_CNTL, EN, 0);
+		return;
+	}
+
 	/* Use deinitialize sequence from CAIL when unbinding device
 	 * from driver, otherwise KIQ is hanging when binding back
 	 */
@@ -1984,7 +1996,8 @@ static int gfx_v9_4_3_hw_init(void *handle)
 	int r;
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-	gfx_v9_4_3_init_golden_registers(adev);
+	if (!amdgpu_sriov_vf(adev))
+		gfx_v9_4_3_init_golden_registers(adev);
 
 	gfx_v9_4_3_constants_init(adev);
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/2
#2 lore raw
In reply to Zhigang Luo

[Public]

Series is:

________________________________
From: Luo, Zhigang <[email protected]>
Sent: Thursday, June 15, 2023 1:49 PM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Luo, Zhigang <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: Skip TMR for MP0_HWIP 13.0.6

For SRIOV VF, no TMR needed.

Change-Id If9556cf60dfcbd95e102b1387cf233e902d9490e
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
index e15c27e05564..ac9b57231589 100644
@@ -839,6 +839,7 @@ static bool psp_skip_tmr(struct psp_context *psp)
         case IP_VERSION(11, 0, 9):
         case IP_VERSION(11, 0, 7):
         case IP_VERSION(13, 0, 2):
+       case IP_VERSION(13, 0, 6):
         case IP_VERSION(13, 0, 10):
                 return true;
         default:

--
2.25.1