Skip to contentSkip to conversation

drm/amd/pm: add support for checking SDMA reset capability

PATCH Superseded [email protected] 3 participants 9 messages Feb 14, 2025 – Feb 21, 2025

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amd/pm: add support for checking SDMA reset capability

From: "[email protected]" <[email protected]>

This patch introduces a new function to check if the SMU supports resetting the SDMA engine. This capability check ensures that the driver does not attempt to reset the SDMA engine on hardware that does not support it.

The following changes are included:
- New function amdgpu_dpm_reset_sdma_is_supported to check SDMA reset support at the AMDGPU driver level.
- New function smu_reset_sdma_is_supported to check SDMA reset support at the SMU level.
- Implementation of smu_v13_0_6_reset_sdma_is_supported for the specific SMU version v13.0.6.
- Updated smu_v13_0_6_reset_sdma to use the new capability check before attempting to reset the SDMA engine.

---
 drivers/gpu/drm/amd/pm/amdgpu_dpm.c           | 23 +++++++++++++++++++
 drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h       |  1 +
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c     | 17 ++++++++++++++
 drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h |  5 ++++
 .../drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c  | 23 ++++++++++++++++++-
 5 files changed, 68 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +23 -0
index 6a9e26905edf..010f05a44287 100644
@@ -719,6 +719,29 @@ int amdgpu_dpm_send_rma_reason(struct amdgpu_device *adev)
 	return ret;
 }
 
+/**
+ * amdgpu_dpm_reset_sdma_is_supported - Check if SDMA reset is supported
+ * @adev: amdgpu_device pointer
+ *
+ * This function checks if the SMU supports resetting the SDMA engine.
+ * It returns -EOPNOTSUPP if the hardware does not support software SMU or
+ * if the feature is not supported.
+ */
+int amdgpu_dpm_reset_sdma_is_supported(struct amdgpu_device *adev)
+{
+	struct smu_context *smu = adev->powerplay.pp_handle;
+	int ret;
+
+	if (!is_support_sw_smu(adev))
+		return -EOPNOTSUPP;
+
+	mutex_lock(&adev->pm.mutex);
+	ret = smu_reset_sdma_is_supported(smu);
+	mutex_unlock(&adev->pm.mutex);
+
+	return ret;
+}
+
 int amdgpu_dpm_reset_sdma(struct amdgpu_device *adev, uint32_t inst_mask)
 {
 	struct smu_context *smu = adev->powerplay.pp_handle;
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h +1 -0
index 1f5ac7e0230d..353a10119dc5 100644
@@ -603,5 +603,6 @@ int amdgpu_dpm_set_pm_policy(struct amdgpu_device *adev, int policy_type,
 ssize_t amdgpu_dpm_get_pm_policy_info(struct amdgpu_device *adev,
 				      enum pp_pm_policy p_type, char *buf);
 int amdgpu_dpm_reset_sdma(struct amdgpu_device *adev, uint32_t inst_mask);
+int amdgpu_dpm_reset_sdma_is_supported(struct amdgpu_device *adev);
 
 #endif
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +17 -0
index 488360d2aaae..a61c80aed24c 100644
@@ -3903,6 +3903,23 @@ int smu_send_rma_reason(struct smu_context *smu)
 	return ret;
 }
 
+/**
+ * smu_reset_sdma_is_supported - Check if SDMA reset is supported by SMU
+ * @smu: smu_context pointer
+ *
+ * This function checks if the SMU supports resetting the SDMA engine.
+ * It returns 0 if supported, -EOPNOTSUPP otherwise.
+ */
+int smu_reset_sdma_is_supported(struct smu_context *smu)
+{
+	int ret = 0;
+
+	if (smu->ppt_funcs && smu->ppt_funcs->reset_sdma_is_supported)
+		ret = smu->ppt_funcs->reset_sdma_is_supported(smu);
+
+	return ret;
+}
+
 int smu_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
 {
 	int ret = 0;
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +5 -0
index 3630593bce61..090a2b3b81a0 100644
@@ -1376,6 +1376,10 @@ struct pptable_funcs {
 	 * @reset_sdma: message SMU to soft reset sdma instance.
 	 */
 	int (*reset_sdma)(struct smu_context *smu, uint32_t inst_mask);
+	/**
+	 * @reset_sdma_is_supported: Check if support resets the SDMA engine.
+	 */
+	int (*reset_sdma_is_supported)(struct smu_context *smu);
 
 	/**
 	 * @get_ecc_table:  message SMU to get ECC INFO table.
@@ -1637,6 +1641,7 @@ int smu_send_hbm_bad_pages_num(struct smu_context *smu, uint32_t size);
 int smu_send_hbm_bad_channel_flag(struct smu_context *smu, uint32_t size);
 int smu_send_rma_reason(struct smu_context *smu);
 int smu_reset_sdma(struct smu_context *smu, uint32_t inst_mask);
+int smu_reset_sdma_is_supported(struct smu_context *smu);
 int smu_set_pm_policy(struct smu_context *smu, enum pp_pm_policy p_type,
 		      int level);
 ssize_t smu_get_pm_policy_info(struct smu_context *smu,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +22 -1
index d645387beaa4..b69d8c26ca8b 100644
@@ -2902,11 +2902,31 @@ static int smu_v13_0_6_send_rma_reason(struct smu_context *smu)
 	return ret;
 }
 
+/**
+ * smu_v13_0_6_reset_sdma_is_supported - Check if SDMA reset is supported
+ * @smu: smu_context pointer
+ *
+ * This function checks if the SMU supports resetting the SDMA engine.
+ * It returns -EOPNOTSUPP if the capability is not supported.
+ */
+static int smu_v13_0_6_reset_sdma_is_supported(struct smu_context *smu)
+{
+	int ret = 0;
+
+	if (!smu_v13_0_6_cap_supported(smu, SMU_CAP(SDMA_RESET))) {
+		dev_info(smu->adev->dev,
+			"SDMA reset capability is not supported\n");
+		ret = EOPNOTSUPP;
+	}
+
+	return ret;
+}
+
 static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
 {
 	int ret = 0;
 
-	if (!smu_v13_0_6_cap_supported(smu, SMU_CAP(SDMA_RESET)))
+	if (smu_v13_0_6_reset_sdma_is_supported(smu))
 		return -EOPNOTSUPP;
 
 	ret = smu_cmn_send_smc_msg_with_param(smu,
@@ -3590,6 +3610,7 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
 	.send_hbm_bad_pages_num = smu_v13_0_6_smu_send_hbm_bad_page_num,
 	.send_rma_reason = smu_v13_0_6_send_rma_reason,
 	.reset_sdma = smu_v13_0_6_reset_sdma,
+	.reset_sdma_is_supported = smu_v13_0_6_reset_sdma_is_supported,
 };
 
 void smu_v13_0_6_set_ppt_funcs(struct smu_context *smu)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 drm/amdgpu: Enable per-queue reset support

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if the PMFW supports SDMA reset using amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -1
index b24a1ff5d743..e01d97b96655 100644
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block)
 		}
 	}
 
-	/* TODO: Add queue reset mask when FW fully supports it */
 	adev->sdma.supported_reset =
 		amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+	if (adev->gfx.mec_fw_version >= 0xb0 && amdgpu_dpm_reset_sdma_is_supported(adev))
+		adev->sdma.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;
 
 	if (amdgpu_sdma_ras_sw_init(adev)) {
 		dev_err(adev->dev, "fail to initialize sdma ras block\n");
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

Quoted 24 lines · On 2/14/2025 11:25 AM, [email protected] wrote:

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if the PMFW supports SDMA reset using amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
index b24a1ff5d743..e01d97b96655 100644

drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block) · line 1487

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -1
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block)
 		}
 	}
 
-	/* TODO: Add queue reset mask when FW fully supports it */
 	adev->sdma.supported_reset =
 		amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+	if (adev->gfx.mec_fw_version >= 0xb0 && amdgpu_dpm_reset_sdma_is_supported(adev))
+		adev->sdma.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;

This function is reused across multiple IP versions. MEC fw versions aren't the same across those IP versions.

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
 	if (amdgpu_sdma_ras_sw_init(adev)) {
 		dev_err(adev->dev, "fail to initialize sdma ras block\n");
#3 lore raw

RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Lijo,
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, February 14, 2025 2:10 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Prosyak, Vitaly <[email protected]>
Subject: Re: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

Quoted 25 lines · On 2/14/2025 11:25 AM, [email protected] wrote:

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if the PMFW supports SDMA reset using amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
index b24a1ff5d743..e01d97b96655 100644

drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block) · line 1487

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -1
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block)
              }
      }
 
-     /* TODO: Add queue reset mask when FW fully supports it */
      adev->sdma.supported_reset =
              amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+     if (adev->gfx.mec_fw_version >= 0xb0 && amdgpu_dpm_reset_sdma_is_supported(adev))
+             adev->sdma.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;

This function is reused across multiple IP versions. MEC fw versions aren't the same across those IP versions.

In fact, the user queue relies on MEC fw and pmfw when the sdma queue do reset. So we need to check both of them at here to skip old mec and pmfw.

Thanks
Jesse

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
      if (amdgpu_sdma_ras_sw_init(adev)) {
              dev_err(adev->dev, "fail to initialize sdma ras block\n");
#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

Quoted 49 lines · Jesse(Jie)

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Lijo,
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, February 14, 2025 2:10 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Prosyak, Vitaly <[email protected]>
Subject: Re: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

Quoted 25 lines · On 2/14/2025 11:25 AM, [email protected] wrote:

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if the PMFW supports SDMA reset using amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
index b24a1ff5d743..e01d97b96655 100644

drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block) · line 1487

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -1
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block)
              }
      }
 
-     /* TODO: Add queue reset mask when FW fully supports it */
      adev->sdma.supported_reset =
              amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+     if (adev->gfx.mec_fw_version >= 0xb0 && amdgpu_dpm_reset_sdma_is_supported(adev))
+             adev->sdma.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE;

This function is reused across multiple IP versions. MEC fw versions aren't the same across those IP versions.

Quoted 3 lines

In fact, the user queue relies on MEC fw and pmfw when the sdma queue do reset. So we need to check both of them at here to skip old mec and pmfw.

To make it clear -
MEC FW >= 0xb0 is having reset support for say GC 9.4.3. With GC 9.5.0, MEC FW 0x20 may have the same support.

Thanks,
Lijo

Quoted 10 lines

Thanks
Jesse

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
      if (amdgpu_sdma_ras_sw_init(adev)) {
              dev_err(adev->dev, "fail to initialize sdma ras block\n");
#5 lore raw

RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, February 14, 2025 2:54 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Prosyak, Vitaly <[email protected]>
Subject: Re: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

Quoted 54 lines · Jesse(Jie)

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Lijo,
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Friday, February 14, 2025 2:10 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Prosyak, Vitaly <[email protected]>
Subject: Re: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

Quoted 25 lines · On 2/14/2025 11:25 AM, [email protected] wrote:

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if the PMFW supports SDMA reset using amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
index b24a1ff5d743..e01d97b96655 100644

drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block) · line 1489

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +3 -1
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct amdgpu_ip_block *ip_block)
              }
      }
 
-     /* TODO: Add queue reset mask when FW fully supports it */
      adev->sdma.supported_reset =
 
 amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+     if (adev->gfx.mec_fw_version >= 0xb0 && amdgpu_dpm_reset_sdma_is_supported(adev))
+             adev->sdma.supported_reset |=
+ AMDGPU_RESET_TYPE_PER_QUEUE;

This function is reused across multiple IP versions. MEC fw versions aren't the same across those IP versions.

Quoted 3 lines

In fact, the user queue relies on MEC fw and pmfw when the sdma queue do reset. So we need to check both of them at here to skip old mec and pmfw.

To make it clear -
MEC FW >= 0xb0 is having reset support for say GC 9.4.3. With GC 9.5.0, MEC FW 0x20 may have the same support.
Thanks Lijo. Will double check with MEC fw team about GC9.5.0

Thanks,
Lijo

Quoted 11 lines

Thanks
Jesse

Thanks,
Lijo

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
      if (amdgpu_sdma_ras_sw_init(adev)) {
              dev_err(adev->dev, "fail to initialize sdma ras

block\n");

#6 lore raw

RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

In reply to [email protected]

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jesse,

Quoted 40 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of [email protected]
Sent: Friday, February 14, 2025 1:56 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Prosyak, Vitaly <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if
the PMFW supports SDMA reset using
amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in
adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -0
index b24a1ff5d743..e01d97b96655 100644
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct
 amdgpu_ip_block *ip_block)

drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c static int sdma_v4_4_2_sw_init(struct · line 1490

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -1
              }
      }
 
-     /* TODO: Add queue reset mask when FW fully supports it */
      adev->sdma.supported_reset =
              amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+     if (adev->gfx.mec_fw_version >= 0xb0 &&
 amdgpu_dpm_reset_sdma_is_supported(adev))
+             adev->sdma.supported_reset |=
 AMDGPU_RESET_TYPE_PER_QUEUE;

So, we do not have SDMA firmware version dependency here, correct?

Tim

Quoted 5 lines
      if (amdgpu_sdma_ras_sw_init(adev)) {
              dev_err(adev->dev, "fail to initialize sdma ras block\n");

--
2.25.1

#7 lore raw

RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Huang, Tim <[email protected]>
Sent: Friday, February 21, 2025 2:46 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Prosyak, Vitaly <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jesse,

Quoted 50 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of [email protected]
Sent: Friday, February 14, 2025 1:56 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Prosyak, Vitaly <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if
the PMFW supports SDMA reset using
amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in
adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -1
index b24a1ff5d743..e01d97b96655 100644
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct
 amdgpu_ip_block *ip_block)
              }
      }
 
-     /* TODO: Add queue reset mask when FW fully supports it */
      adev->sdma.supported_reset =
 
 amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+     if (adev->gfx.mec_fw_version >= 0xb0 &&
 amdgpu_dpm_reset_sdma_is_supported(adev))
+             adev->sdma.supported_reset |=
Quoted 1 line

AMDGPU_RESET_TYPE_PER_QUEUE;

So, we do not have SDMA firmware version dependency here, correct?
Yes, sdma queue reset use pmfw interface, and it only depends on pmfw and mec firmware.
Jesse

Tim

Quoted 6 lines
      if (amdgpu_sdma_ras_sw_init(adev)) {
              dev_err(adev->dev, "fail to initialize sdma ras

block\n");
--
2.25.1

Reviewed-by
#8 lore raw

RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jesse,

Quoted 72 lines

-----Original Message-----
From: Zhang, Jesse(Jie) <[email protected]>
Sent: Friday, February 21, 2025 2:50 PM
To: Huang, Tim <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Prosyak, Vitaly <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Huang, Tim <[email protected]>
Sent: Friday, February 21, 2025 2:46 PM
To: Zhang, Jesse(Jie) <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Prosyak, Vitaly <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: RE: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jesse,

Quoted 46 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of [email protected]
Sent: Friday, February 14, 2025 1:56 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Kim, Jonathan <[email protected]>; Zhu, Jiadong <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Prosyak, Vitaly <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 2/2] drm/amdgpu: Enable per-queue reset support

From: "[email protected]" <[email protected]>

This patch updates the SDMA v4.4.2 software initialization to enable per-queue reset support when the MEC firmware version is 0xb0 or higher and the PMFW supports SDMA reset.

The following changes are included:
- Added a condition to check if the MEC firmware version is at least 0xb0 and if
the PMFW supports SDMA reset using
amdgpu_dpm_reset_sdma_is_supported.
- If both conditions are met, the AMDGPU_RESET_TYPE_PER_QUEUE flag is set in
adev->sdma.supported_reset.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +0 -1
index b24a1ff5d743..e01d97b96655 100644
@@ -1481,9 +1481,10 @@ static int sdma_v4_4_2_sw_init(struct
 amdgpu_ip_block *ip_block)
              }
      }
 
-     /* TODO: Add queue reset mask when FW fully supports it */
      adev->sdma.supported_reset =
 
Quoted 11 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +2 -0
 amdgpu_get_soft_full_reset_mask(&adev->sdma.instance[0].ring);
+     if (adev->gfx.mec_fw_version >= 0xb0 &&
 amdgpu_dpm_reset_sdma_is_supported(adev))
+             adev->sdma.supported_reset |=

AMDGPU_RESET_TYPE_PER_QUEUE;

So, we do not have SDMA firmware version dependency here, correct?
Yes, sdma queue reset use pmfw interface, and it only depends on pmfw
and mec firmware.
Jesse

Thanks for clarification. Series is,

Quoted 9 lines

Tim

Quoted 6 lines
      if (amdgpu_sdma_ras_sw_init(adev)) {
              dev_err(adev->dev, "fail to initialize sdma ras

block\n");
--
2.25.1