Skip to contentSkip to conversation

drm/amd/pm: ingore failure of GmiPwrDnControl

PATCH In review Tao Zhou 2 participants 2 messages Jan 10, 2022

Subsystems (3)
lore
Share & tools
lore

Tao Zhou

author
#0 lore raw

PATCH 1/1 drm/amd/pm: ingore failure of GmiPwrDnControl

PMFW only returns 0 on master die and sends NACK back on other dies for the message.

---
 .../gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c   | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +12 -4
index 261892977654..121b0ab5823f 100644
@@ -1625,10 +1625,18 @@ static int aldebaran_set_df_cstate(struct smu_context *smu,
 
 static int aldebaran_allow_xgmi_power_down(struct smu_context *smu, bool en)
 {
-	return smu_cmn_send_smc_msg_with_param(smu,
-					       SMU_MSG_GmiPwrDnControl,
-					       en ? 0 : 1,
-					       NULL);
+	int ret;
+
+	ret = smu_cmn_send_smc_msg_with_param(smu,
+					   SMU_MSG_GmiPwrDnControl,
+					   en ? 0 : 1,
+					   NULL);
+	/* The message only works on master die and NACK will be sent
+	   back for other dies, ingore CMD failure for the message */
+	if (ret == -EIO)
+		ret = 0;
+
+	return ret;
 }
 
 static const struct throttling_logging_label {
Signature · 1 line
2.17.1
#1 lore raw
Quoted 21 lines · Tao Zhou

PMFW only returns 0 on master die and sends NACK back on other dies for the message.

---
  .../gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c   | 16 ++++++++++++----
  1 file changed, 12 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +1 -4
index 261892977654..121b0ab5823f 100644
@@ -1625,10 +1625,18 @@ static int aldebaran_set_df_cstate(struct smu_context *smu,
 
  static int aldebaran_allow_xgmi_power_down(struct smu_context *smu, bool en)
  {
-	return smu_cmn_send_smc_msg_with_param(smu,
-					       SMU_MSG_GmiPwrDnControl,
-					       en ? 0 : 1,
-					       NULL);
+	int ret;

drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c static int aldebaran_set_df_cstate(struct smu_context *smu, · line 1638

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +10 -0
+
+	ret = smu_cmn_send_smc_msg_with_param(smu,
+					   SMU_MSG_GmiPwrDnControl,
+					   en ? 0 : 1,
+					   NULL);
+	/* The message only works on master die and NACK will be sent
+	   back for other dies, ingore CMD failure for the message */
+	if (ret == -EIO)
+		ret = 0;
+

Could you confirm if this is hive master or primary die of each device? If it's the latter, use aldebaran_is_primary(). For the former we can add support similar to is_primary().

Thanks,
Lijo

Quoted 5 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +1 -0
+	return ret;
  }
 
  static const struct throttling_logging_label {