[AMD Official Use Only - AMD Internal Distribution Only]

Please add following information into commit message.

Fixes: bd3c9d1cde0c  ("drm/amd/pm: fix and simplify workload handling”)

Series is

Reviewed-by: Yang Wang <[email protected]>

Best Regards,
Kevin
-----Original Message-----
From: Kenneth Feng <[email protected]>
Sent: Tuesday, March 11, 2025 16:55
To: [email protected]
Cc: Wang, Yang(Kevin) <[email protected]>; Deucher, Alexander 
<[email protected]>; Feng, Kenneth <[email protected]>
Subject: [PATCH 2/2] drm/amd/pm: prevent skipping the workload setting back to 
bootup default

This is a bug fix. The scenario is that the same client can add the certain 
workload type refcount multiple times. Then the same client can not remove this 
setting when it wants to get back to the default bootup workload.

Signed-off-by: Kenneth Feng <[email protected]>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c 
b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 8cfb07549f54..592bf54015c6 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -2273,7 +2273,8 @@ static int smu_bump_power_profile_mode(struct smu_context 
*smu,  static void smu_power_profile_mode_get(struct smu_context *smu,
                                       enum PP_SMC_POWER_PROFILE profile_mode)  
{
-       smu->workload_refcount[profile_mode]++;
+       if (!smu->workload_refcount[profile_mode])
+               smu->workload_refcount[profile_mode]++;
 }

 static void smu_power_profile_mode_put(struct smu_context *smu,
--
2.34.1

Reply via email to