Skip to contentSkip to conversation

drm/amdgpu: Don't warn for unsupported set_xgmi_plpd_mode

PATCH In review Tao Zhou 2 participants 2 messages Nov 2, 2023 – Nov 7, 2023

Subsystems (2)
lore
Share & tools
lore

Tao Zhou

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Don't warn for unsupported set_xgmi_plpd_mode

set_xgmi_plpd_mode may be unsupported and this isn't error, no need to print warning for it.

v2: add ret2 to save the status of psp_ras_trigger_error.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +8 -6
index 0533f873001b..a5a72e5aae94 100644
@@ -1131,28 +1131,30 @@ static void amdgpu_xgmi_query_ras_error_count(struct amdgpu_device *adev,
 static int amdgpu_ras_error_inject_xgmi(struct amdgpu_device *adev,
 			void *inject_if, uint32_t instance_mask)
 {
-	int ret = 0;
+	int ret1, ret2;
 	struct ta_ras_trigger_error_input *block_info =
 				(struct ta_ras_trigger_error_input *)inject_if;
 
 	if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))
 		dev_warn(adev->dev, "Failed to disallow df cstate");
 
-	if (amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DISALLOW))
+	ret1 = amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DISALLOW);
+	if (ret1 && ret1 != -EOPNOTSUPP)
 		dev_warn(adev->dev, "Failed to disallow XGMI power down");
 
-	ret = psp_ras_trigger_error(&adev->psp, block_info, instance_mask);
+	ret2 = psp_ras_trigger_error(&adev->psp, block_info, instance_mask);
 
 	if (amdgpu_ras_intr_triggered())
-		return ret;
+		return ret2;
 
-	if (amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DEFAULT))
+	ret1 = amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DEFAULT);
+	if (ret1 && ret1 != -EOPNOTSUPP)
 		dev_warn(adev->dev, "Failed to allow XGMI power down");
 
 	if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_ALLOW))
 		dev_warn(adev->dev, "Failed to allow df cstate");
 
-	return ret;
+	return ret2;
 }
 
 struct amdgpu_ras_block_hw_ops  xgmi_ras_hw_ops = {
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Tao Zhou
Sent: Thursday, November 2, 2023 17:03
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Zhou1, Tao <[email protected]>
Subject: [PATCH] drm/amdgpu: Don't warn for unsupported set_xgmi_plpd_mode

set_xgmi_plpd_mode may be unsupported and this isn't error, no need to print warning for it.

v2: add ret2 to save the status of psp_ras_trigger_error.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +8 -7
index 0533f873001b..a5a72e5aae94 100644
@@ -1131,28 +1131,30 @@ static void amdgpu_xgmi_query_ras_error_count(struct amdgpu_device *adev,  static int amdgpu_ras_error_inject_xgmi(struct amdgpu_device *adev,
                        void *inject_if, uint32_t instance_mask)  {
-       int ret = 0;
+       int ret1, ret2;
        struct ta_ras_trigger_error_input *block_info =
                                (struct ta_ras_trigger_error_input *)inject_if;
 
        if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))
                dev_warn(adev->dev, "Failed to disallow df cstate");
 
-       if (amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DISALLOW))
+       ret1 = amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DISALLOW);
+       if (ret1 && ret1 != -EOPNOTSUPP)
                dev_warn(adev->dev, "Failed to disallow XGMI power down");
 
-       ret = psp_ras_trigger_error(&adev->psp, block_info, instance_mask);
+       ret2 = psp_ras_trigger_error(&adev->psp, block_info, instance_mask);
 
        if (amdgpu_ras_intr_triggered())
-               return ret;
+               return ret2;
 
-       if (amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DEFAULT))
+       ret1 = amdgpu_dpm_set_xgmi_plpd_mode(adev, XGMI_PLPD_DEFAULT);
+       if (ret1 && ret1 != -EOPNOTSUPP)
                dev_warn(adev->dev, "Failed to allow XGMI power down");
 
        if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_ALLOW))
                dev_warn(adev->dev, "Failed to allow df cstate");
 
-       return ret;
+       return ret2;
 }
 
 struct amdgpu_ras_block_hw_ops  xgmi_ras_hw_ops = {
--

2.35.1