Skip to contentSkip to conversation

drm/amdgpu: skip MGCG programming on a VF for gfx v12_1

PATCH In review YuBiao Wang 2 participants 2 messages Sep 24 – Sep 29

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

PATCH 1/1 drm/amdgpu: skip MGCG programming on a VF for gfx v12_1

MGCG registers are PF-only. Skip programming them under SR-IOV.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +7 -4
index 4f6eac30b235..c9de9216bd65 100644
@@ -2417,8 +2417,10 @@ static int gfx_v12_1_xcc_cp_resume(struct amdgpu_device *adev, uint16_t xcc_mask
 				return r;
 		}
 
-		gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, false,
-							       xcc_id, true);
+		/* MGCG is device wide and owned by the PF */
+		if (!amdgpu_sriov_vf(adev))
+			gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, false,
+								       xcc_id, true);
 		/* GFX CGCG and LS is disabled by rlc fw */
 		gfx_v12_1_xcc_enable_gui_idle_interrupt(adev, false, xcc_id);
 
@@ -2440,8 +2442,9 @@ static int gfx_v12_1_xcc_cp_resume(struct amdgpu_device *adev, uint16_t xcc_mask
 			if (r)
 				return r;
 		}
-		gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, true,
-							       xcc_id, true);
+		if (!amdgpu_sriov_vf(adev))
+			gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, true,
+								       xcc_id, true);
 	}
 
 	return 0;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · YuBiao Wang

MGCG registers are PF-only. Skip programming them under SR-IOV.

Thanks,
Lijo

Quoted 33 lines
---
  drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 11 +++++++----
  1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +7 -4
index 4f6eac30b235..c9de9216bd65 100644
@@ -2417,8 +2417,10 @@ static int gfx_v12_1_xcc_cp_resume(struct amdgpu_device *adev, uint16_t xcc_mask
  				return r;
  		}
 
-		gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, false,
-							       xcc_id, true);
+		/* MGCG is device wide and owned by the PF */
+		if (!amdgpu_sriov_vf(adev))
+			gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, false,
+								       xcc_id, true);
  		/* GFX CGCG and LS is disabled by rlc fw */
  		gfx_v12_1_xcc_enable_gui_idle_interrupt(adev, false, xcc_id);
 
@@ -2440,8 +2442,9 @@ static int gfx_v12_1_xcc_cp_resume(struct amdgpu_device *adev, uint16_t xcc_mask
  			if (r)
  				return r;
  		}
-		gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, true,
-							       xcc_id, true);
+		if (!amdgpu_sriov_vf(adev))
+			gfx_v12_1_xcc_update_medium_grain_clock_gating(adev, true,
+								       xcc_id, true);
  	}
 
  	return 0;