Skip to contentSkip to conversation

drm/amd/pm: remove unnecessary prints for smu busy

PATCH In review Gangliang Xie 3 participants 3 messages Nov 6, 2025

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

PATCH 1/1 drm/amd/pm: remove unnecessary prints for smu busy

smu busy is a normal case when calling SMU_MSG_GetBadPageCount, so no need to print error status at each time.Instead, only print error status when timeout given by user is reached.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 2 ++
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c                | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +2 -0
index 0ce8cff27bf9..fc580800609c 100644
@@ -956,6 +956,8 @@ static int smu_v13_0_12_get_badpage_count(struct amdgpu_device *adev, uint32_t *
 		now = (uint64_t)ktime_to_ms(ktime_get());
 	} while (now < end);
 
+	dev_err(adev->dev,
+			 "smu get bad page count timeout!\n");
 	return ret;
 }
 
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +4 -3
index 3b98065dac1d..ca575ecbe36f 100644
@@ -164,9 +164,10 @@ static void __smu_cmn_reg_print_error(struct smu_context *smu,
 				    msg_index, param, message);
 		break;
 	case SMU_RESP_BUSY_OTHER:
-		dev_err_ratelimited(adev->dev,
-				    "SMU: I'm very busy for your command: index:%d param:0x%08X message:%s",
-				    msg_index, param, message);
+		if (msg != SMU_MSG_GetBadPageCount)
+			dev_err_ratelimited(adev->dev,
+						"SMU: I'm very busy for your command: index:%d param:0x%08X message:%s",
+						msg_index, param, message);
 		break;
 	case SMU_RESP_DEBUG_END:
 		dev_err_ratelimited(adev->dev,
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Quoted 38 lines

-----Original Message-----
From: Xie, Patrick <[email protected]>
Sent: Thursday, November 6, 2025 3:50 PM
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Xie, Patrick <[email protected]>
Subject: [PATCH] drm/amd/pm: remove unnecessary prints for smu busy

smu busy is a normal case when calling SMU_MSG_GetBadPageCount, so no need to print error status at each time.Instead, only print error status when timeout given by user is reached.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 2 ++
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c                | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +0 -0
index 0ce8cff27bf9..fc580800609c 100644
@@ -956,6 +956,8 @@ static int smu_v13_0_12_get_badpage_count(struct

amdgpu_device *adev, uint32_t *

              now = (uint64_t)ktime_to_ms(ktime_get());
      } while (now < end);
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +2 -0
+     dev_err(adev->dev,
+                      "smu get bad page count timeout!\n");
      return ret;
 }
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -0
index 3b98065dac1d..ca575ecbe36f 100644

drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c static void __smu_cmn_reg_print_error(struct smu_context · line 171

Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -3
@@ -164,9 +164,10 @@ static void __smu_cmn_reg_print_error(struct smu_context
 *smu,
                                  msg_index, param, message);
              break;
      case SMU_RESP_BUSY_OTHER:
-             dev_err_ratelimited(adev->dev,
-                                 "SMU: I'm very busy for your command: index:%d
 param:0x%08X message:%s",
-                                 msg_index, param, message);

[Tao] better to add comment here to explain why SMU_MSG_GetBadPageCount is special.

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +4 -0
+             if (msg != SMU_MSG_GetBadPageCount)
+                     dev_err_ratelimited(adev->dev,
+                                             "SMU: I'm very busy for your command:
 index:%d param:0x%08X message:%s",
+                                             msg_index, param, message);
              break;
      case SMU_RESP_DEBUG_END:
              dev_err_ratelimited(adev->dev,

--
2.34.1

#2 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Thanks, Tao
Sure, will update it.

-----Original Message-----
From: Zhou1, Tao <[email protected]>
Sent: Thursday, November 6, 2025 4:46 PM
To: Xie, Patrick <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amd/pm: remove unnecessary prints for smu busy

[AMD Official Use Only - AMD Internal Distribution Only]

Quoted 39 lines

-----Original Message-----
From: Xie, Patrick <[email protected]>
Sent: Thursday, November 6, 2025 3:50 PM
To: [email protected]
Cc: Zhou1, Tao <[email protected]>; Xie, Patrick <[email protected]>
Subject: [PATCH] drm/amd/pm: remove unnecessary prints for smu busy

smu busy is a normal case when calling SMU_MSG_GetBadPageCount, so no need to print error status at each time.Instead, only print error status when timeout given by user is reached.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c | 2 ++
 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c                | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +0 -0
index 0ce8cff27bf9..fc580800609c 100644
@@ -956,6 +956,8 @@ static int smu_v13_0_12_get_badpage_count(struct

amdgpu_device *adev, uint32_t *

              now = (uint64_t)ktime_to_ms(ktime_get());
      } while (now < end);
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c +2 -0
+     dev_err(adev->dev,
+                      "smu get bad page count timeout!\n");
      return ret;
 }
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -0
index 3b98065dac1d..ca575ecbe36f 100644

drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c static void __smu_cmn_reg_print_error(struct · line 171

Quoted 8 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +0 -3
@@ -164,9 +164,10 @@ static void __smu_cmn_reg_print_error(struct
 smu_context *smu,
                                  msg_index, param, message);
              break;
      case SMU_RESP_BUSY_OTHER:
-             dev_err_ratelimited(adev->dev,
-                                 "SMU: I'm very busy for your command: index:%d
 param:0x%08X message:%s",
-                                 msg_index, param, message);

[Tao] better to add comment here to explain why SMU_MSG_GetBadPageCount is special.

Quoted 11 lines
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +5 -1
+             if (msg != SMU_MSG_GetBadPageCount)
+                     dev_err_ratelimited(adev->dev,
+                                             "SMU: I'm very busy for your command:
 index:%d param:0x%08X message:%s",
+                                             msg_index, param,
+ message);
              break;
      case SMU_RESP_DEBUG_END:
              dev_err_ratelimited(adev->dev,
--

2.34.1