Skip to contentSkip to conversation

drm/amdgpu: fix reporting of failed msg sent to SMU

PATCH In review S, Shirish 2 participants 2 messages Oct 25, 2018 – Oct 26, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

S, Shirish

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix reporting of failed msg sent to SMU

Currently send_msg_to_smc_async() only report which message failed, but the actual failing message is the previous one, which SMU is unable to service.

This patch reads the contents of register where the SMU is stuck and report appropriately.

---
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c +5 -0
index f836d30..b1007b8 100644
@@ -64,6 +64,7 @@ static uint32_t smu8_get_argument(struct pp_hwmgr *hwmgr)
 static int smu8_send_msg_to_smc_async(struct pp_hwmgr *hwmgr, uint16_t msg)
 {
 	int result = 0;
+	uint32_t = val;
 
 	if (hwmgr == NULL || hwmgr->device == NULL)
 		return -EINVAL;
@@ -71,7 +72,11 @@ static int smu8_send_msg_to_smc_async(struct pp_hwmgr *hwmgr, uint16_t msg)
 	result = PHM_WAIT_FIELD_UNEQUAL(hwmgr,
 					SMU_MP1_SRBM2P_RESP_0, CONTENT, 0);
 	if (result != 0) {
+		/* Read the last message to SMU, to report actual cause */
+		val = cgs_read_register(hwmgr->device,
+					mmSMU_MP1_SRBM2P_MSG_0);
 		pr_err("smu8_send_msg_to_smc_async (0x%04x) failed\n", msg);
+		pr_err("SMU still servicing msg (0x%04x)\n", val);
 		return result;
 	}
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1540507023-12006-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Patch is Reviewed-by: Rex Zhu <[email protected]>

Rex

Quoted 51 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of S, Shirish
Sent: Friday, October 26, 2018 6:37 AM
To: Deucher, Alexander <[email protected]>; Zhu, Rex <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: [PATCH] drm/amdgpu: fix reporting of failed msg sent to SMU

Currently send_msg_to_smc_async() only report which message failed, but the actual failing message is the previous one, which SMU is unable to service.

This patch reads the contents of register where the SMU is stuck and report appropriately.

---
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c +5 -0
index f836d30..b1007b8 100644
@@ -64,6 +64,7 @@ static uint32_t smu8_get_argument(struct pp_hwmgr
 *hwmgr)  static int smu8_send_msg_to_smc_async(struct pp_hwmgr
 *hwmgr, uint16_t msg)  {
 	int result = 0;
+	uint32_t = val;
 
 	if (hwmgr == NULL || hwmgr->device == NULL)
 		return -EINVAL;
@@ -71,7 +72,11 @@ static int smu8_send_msg_to_smc_async(struct
 pp_hwmgr *hwmgr, uint16_t msg)
 	result = PHM_WAIT_FIELD_UNEQUAL(hwmgr,
 					SMU_MP1_SRBM2P_RESP_0,
 CONTENT, 0);
 	if (result != 0) {
+		/* Read the last message to SMU, to report actual cause */
+		val = cgs_read_register(hwmgr->device,
+					mmSMU_MP1_SRBM2P_MSG_0);
 		pr_err("smu8_send_msg_to_smc_async (0x%04x) failed\n",
 msg);
+		pr_err("SMU still servicing msg (0x%04x)\n", val);
drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c +0 -1
 		return result;
 	}
 
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx