Skip to contentSkip to conversation

drm/amdgpu/vcn4.0.3: gate VCN reset on PSP FW for MP0 13.0.6

PATCH In review Jesse.Zhang 2 participants 2 messages Mar 23

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

PATCH 1/1 drm/amdgpu/vcn4.0.3: gate VCN reset on PSP FW for MP0 13.0.6

Add a PSP SOS firmware compatibility check before enabling VCN per-queue reset on vcn_v4_0_3.

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +23 -1
index e78526a4e521..7cc8f6389152 100644
@@ -134,6 +134,26 @@ static int vcn_v4_0_3_early_init(struct amdgpu_ip_block *ip_block)
 	return 0;
 }
 
+static bool vcn_v4_0_3_is_psp_fw_reset_supported(struct amdgpu_device *adev)
+{
+	uint32_t fw_ver = adev->psp.sos.fw_version;
+	uint32_t pgm = (fw_ver >> 8) & 0xFF;
+
+	switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
+	case IP_VERSION(13, 0, 6):
+		/*
+		 * FWDEV-159155: PSP SOS FW must be >= 0x0036015f for pgm 0x01
+		 * before enabling VCN per-queue reset on MP0 13.0.6.
+		 */
+		if (pgm == 1)
+			return adev->psp.sos.fw_version >= 0x0036015f;
+		else
+			return true;
+	default:
+		return true;
+	}
+}
+
 static int vcn_v4_0_3_late_init(struct amdgpu_ip_block *ip_block)
 {
 	struct amdgpu_device *adev = ip_block->adev;
@@ -141,7 +161,9 @@ static int vcn_v4_0_3_late_init(struct amdgpu_ip_block *ip_block)
 	adev->vcn.supported_reset =
 		amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]);
 
-	if (amdgpu_dpm_reset_vcn_is_supported(adev) && !amdgpu_sriov_vf(adev))
+	if (amdgpu_dpm_reset_vcn_is_supported(adev) &&
+	    vcn_v4_0_3_is_psp_fw_reset_supported(adev) &&
+	    !amdgpu_sriov_vf(adev))
 		adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
 
 	return 0;
Signature · 1 line
2.49.0
#1 lore raw
Quoted 19 lines · Jesse.Zhang

Add a PSP SOS firmware compatibility check before enabling VCN per-queue reset on vcn_v4_0_3.

---
  drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 24 +++++++++++++++++++++++-
  1 file changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +3 -0
index e78526a4e521..7cc8f6389152 100644
@@ -134,6 +134,26 @@ static int vcn_v4_0_3_early_init(struct amdgpu_ip_block *ip_block)
  	return 0;
  }
 
+static bool vcn_v4_0_3_is_psp_fw_reset_supported(struct amdgpu_device *adev)
+{
+	uint32_t fw_ver = adev->psp.sos.fw_version;

drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c static int vcn_v4_0_3_early_init(struct amdgpu_ip_block *ip_block) · line 149

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +10 -0
+	uint32_t pgm = (fw_ver >> 8) & 0xFF;
+
+	switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
+	case IP_VERSION(13, 0, 6):
+		/*
+		 * FWDEV-159155: PSP SOS FW must be >= 0x0036015f for pgm 0x01
+		 * before enabling VCN per-queue reset on MP0 13.0.6.
+		 */
+		if (pgm == 1)
+			return adev->psp.sos.fw_version >= 0x0036015f;

The program check itself should be good enough.

Thanks,
Lijo

Quoted 21 lines
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +10 -1
+		else
+			return true;
+	default:
+		return true;
+	}
+}
+
  static int vcn_v4_0_3_late_init(struct amdgpu_ip_block *ip_block)
  {
  	struct amdgpu_device *adev = ip_block->adev;
@@ -141,7 +161,9 @@ static int vcn_v4_0_3_late_init(struct amdgpu_ip_block *ip_block)
  	adev->vcn.supported_reset =
  		amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]);
 
-	if (amdgpu_dpm_reset_vcn_is_supported(adev) && !amdgpu_sriov_vf(adev))
+	if (amdgpu_dpm_reset_vcn_is_supported(adev) &&
+	    vcn_v4_0_3_is_psp_fw_reset_supported(adev) &&
+	    !amdgpu_sriov_vf(adev))
  		adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
 
  	return 0;