Skip to contentSkip to conversation

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

PATCH Superseded Yang Wang 2 participants 3 messages Jan 18, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yang Wang

author
#0 lore raw

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

From: Yang Wang <[email protected]>

enable amdgpu smu driver message log.

---
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +7 -1
index 00cd615bbcdc..b9a24ff02a12 100644
@@ -378,8 +378,14 @@ 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, readval: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param, *read_arg);
+	} else {
+		dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param);
+	}
 Out:
 	if (unlikely(adev->pm.smu_debug_mask & SMU_DEBUG_HALT_ON_ERROR) && res) {
 		amdgpu_device_halt(adev);
Signature · 1 line
2.34.1
#1 lore raw
Quoted 16 lines · Yang Wang

From: Yang Wang <[email protected]>

enable amdgpu smu driver message log.

---
  drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -0
index 00cd615bbcdc..b9a24ff02a12 100644
@@ -378,8 +378,14 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
  	res = __smu_cmn_reg2errno(smu, reg);
  	if (res != 0)

drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_send_smc_msg_with_param(struct smu_context *smu, · line 388

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +7 -1
  		__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, readval: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param, *read_arg);
+	} else {
+		dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x\n",
+			smu_get_message_name(smu, msg), index, param);
+	}

Better to add the exact response reg value (reg = __smu_cmn_poll_stat(smu)) also to this.

Thanks,
Lijo

Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -0
  Out:
  	if (unlikely(adev->pm.smu_debug_mask & SMU_DEBUG_HALT_ON_ERROR) && res) {
  		amdgpu_device_halt(adev);
#2 lore raw

[AMD Official Use Only - General]

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

Quoted 16 lines · Yang Wang

From: Yang Wang <[email protected]>

enable amdgpu smu driver message log.

---
  drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -0
index 00cd615bbcdc..b9a24ff02a12 100644
@@ -378,8 +378,14 @@ int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
      res = __smu_cmn_reg2errno(smu, reg);
      if (res != 0)

drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c int smu_cmn_send_smc_msg_with_param(struct smu_context *smu, · line 388

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +7 -1
              __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, readval: 0x%08x\n",
+                     smu_get_message_name(smu, msg), index, param, *read_arg);
+     } else {
+             dev_dbg(adev->dev, "smu send message: %s(%d) param: 0x%08x\n",
+                     smu_get_message_name(smu, msg), index, param);
+     }

Better to add the exact response reg value (reg =
__smu_cmn_poll_stat(smu)) also to this.

Thanks,
Lijo

[kevin]:
OK, will be added in next version.

Best Regards,
Kevin

Quoted 3 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -0
  Out:
      if (unlikely(adev->pm.smu_debug_mask & SMU_DEBUG_HALT_ON_ERROR) && res) {
              amdgpu_device_halt(adev);