Skip to contentSkip to conversation

drm/amd/display: reset dcn31 SMU mailbox on failures

PATCH In review Mario Limonciello 2 participants 2 messages Jan 7, 2022

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

PATCH 1/1 drm/amd/display: reset dcn31 SMU mailbox on failures

Otherwise future commands may fail as well leading to downstream problems that look like they stemmed from a timeout the first time but really didn't.

---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c +6 -0
index 8c2b77eb9459..162ae7186124 100644
@@ -119,6 +119,12 @@ int dcn31_smu_send_msg_with_param(
 
 	result = dcn31_smu_wait_for_response(clk_mgr, 10, 200000);
 
+	if (result == VBIOSSMC_Result_Failed) {
+		ASSERT(0);
+		REG_WRITE(MP1_SMN_C2PMSG_91, VBIOSSMC_Result_OK);
+		return -1;
+	}
+
 	if (IS_SMU_TIMEOUT(result)) {
 		ASSERT(0);
 		dm_helpers_smu_timeout(CTX, msg_id, param, 10 * 200000);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Mario Limonciello

Otherwise future commands may fail as well leading to downstream problems that look like they stemmed from a timeout the first time but really didn't.

I guess we used to do this but after we started adding the wait_for_response prior to sending the command this was ignored.

Should be fine.

Regards,
Nicholas Kazlauskas

Quoted 21 lines
---
  drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c +6 -0
index 8c2b77eb9459..162ae7186124 100644
@@ -119,6 +119,12 @@ int dcn31_smu_send_msg_with_param(
 
  	result = dcn31_smu_wait_for_response(clk_mgr, 10, 200000);
 
+	if (result == VBIOSSMC_Result_Failed) {
+		ASSERT(0);
+		REG_WRITE(MP1_SMN_C2PMSG_91, VBIOSSMC_Result_OK);
+		return -1;
+	}
+
  	if (IS_SMU_TIMEOUT(result)) {
  		ASSERT(0);
  		dm_helpers_smu_timeout(CTX, msg_id, param, 10 * 200000);