Skip to contentSkip to conversation

drm/amd/pm: enable amdgpu smu send message log

PATCH In review Yang Wang 3 participants 3 messages Jan 18, 2024

Subsystems (3)
lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH v2 1/1 drm/amd/pm: enable amdgpu smu send message log

From: Yang Wang <[email protected]>

v1:
enable amdgpu smu driver message log.

v2:
add smu/pmfw response value into debug log.

---
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +8 -1
index 00cd615bbcdc..b8dbd4e25348 100644
@@ -378,8 +378,15 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
 	res = __smu_cmn_reg2errno(smu, reg);
 	if (res != 0)
 		__smu_cmn_reg_print_error(smu, reg, index, param, msg);
-	if (read_arg)
+	if (read_arg) {
 		smu_cmn_read_arg(smu, read_arg);
+		dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x, resp: 0x%08x,\
+			readval: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param, reg, *read_arg);
+	} else {
+		dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x, resp: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param, reg);
+	}
 Out:
 	if (unlikely(adev->pm.smu_debug_mask & SMU_DEBUG_HALT_ON_ERROR) && res) {
 		amdgpu_device_halt(adev);
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 1/1
#1 lore raw

[AMD Official Use Only - General]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yang Wang
Sent: Thursday, January 18, 2024 1:37 PM
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Feng, Kenneth <[email protected]>; Wang, Yang(Kevin) <[email protected]>
Subject: [PATCH v2] drm/amd/pm: enable amdgpu smu send message log

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

From: Yang Wang <[email protected]>

v1:
enable amdgpu smu driver message log.

v2:
add smu/pmfw response value into debug log.

---
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +8 -1
index 00cd615bbcdc..b8dbd4e25348 100644
@@ -378,8 +378,15 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
        res = __smu_cmn_reg2errno(smu, reg);
        if (res != 0)
                __smu_cmn_reg_print_error(smu, reg, index, param, msg);
-       if (read_arg)
+       if (read_arg) {
                smu_cmn_read_arg(smu, read_arg);
+               dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x, resp: 0x%08x,\
+                       readval: 0x%08x\n",
+                       smu_get_message_name(smu, msg), index, param, reg, *read_arg);
+       } else {
+               dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x, resp: 0x%08x\n",
+                       smu_get_message_name(smu, msg), index, param, reg);
+       }
 Out:
        if (unlikely(adev->pm.smu_debug_mask & SMU_DEBUG_HALT_ON_ERROR) && res) {
                amdgpu_device_halt(adev);

--
2.34.1

Reviewed-by on v2 1/1
#2 lore raw
In reply to Yang Wang
Quoted 9 lines · Yang Wang

From: Yang Wang <[email protected]>

v1:
enable amdgpu smu driver message log.

v2:
add smu/pmfw response value into debug log.

Thanks,
Lijo

Quoted 25 lines
---
  drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +8 -1
index 00cd615bbcdc..b8dbd4e25348 100644
@@ -378,8 +378,15 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
  	res = __smu_cmn_reg2errno(smu, reg);
  	if (res != 0)
  		__smu_cmn_reg_print_error(smu, reg, index, param, msg);
-	if (read_arg)
+	if (read_arg) {
  		smu_cmn_read_arg(smu, read_arg);
+		dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x, resp: 0x%08x,\
+			readval: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param, reg, *read_arg);
+	} else {
+		dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x, resp: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param, reg);
+	}
  Out:
  	if (unlikely(adev->pm.smu_debug_mask & SMU_DEBUG_HALT_ON_ERROR) && res) {
  		amdgpu_device_halt(adev);