Skip to content

Commit cdbc3b6

Browse files
Asad Kamalalexdeucher
authored andcommitted
drm/amd/pm: Skip redundant UCLK restore in smu_v13_0_6
Only reapply UCLK soft limits during PP_OD_RESTORE_DEFAULT when the current max differs from the DPM table max. This avoids redundant SMC updates and prevents -EINVAL on restore when no change is needed. Fixes: b7a9003 ("drm/amd/pm: Allow setting max UCLK on SMU v13.0.6") Signed-off-by: Asad Kamal <asad.kamal@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 17f11bb)
1 parent 37c2caa commit cdbc3b6

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,7 @@ static int smu_v13_0_6_usr_edit_dpm_table(struct smu_context *smu,
21222122
{
21232123
struct smu_dpm_context *smu_dpm = &(smu->smu_dpm);
21242124
struct smu_13_0_dpm_context *dpm_context = smu_dpm->dpm_context;
2125+
struct smu_dpm_table *uclk_table = &dpm_context->dpm_tables.uclk_table;
21252126
struct smu_umd_pstate_table *pstate_table = &smu->pstate_table;
21262127
uint32_t min_clk;
21272128
uint32_t max_clk;
@@ -2221,14 +2222,16 @@ static int smu_v13_0_6_usr_edit_dpm_table(struct smu_context *smu,
22212222
if (ret)
22222223
return ret;
22232224

2224-
min_clk = SMU_DPM_TABLE_MIN(
2225-
&dpm_context->dpm_tables.uclk_table);
2226-
max_clk = SMU_DPM_TABLE_MAX(
2227-
&dpm_context->dpm_tables.uclk_table);
2228-
ret = smu_v13_0_6_set_soft_freq_limited_range(
2229-
smu, SMU_UCLK, min_clk, max_clk, false);
2230-
if (ret)
2231-
return ret;
2225+
if (SMU_DPM_TABLE_MAX(uclk_table) !=
2226+
pstate_table->uclk_pstate.curr.max) {
2227+
min_clk = SMU_DPM_TABLE_MIN(&dpm_context->dpm_tables.uclk_table);
2228+
max_clk = SMU_DPM_TABLE_MAX(&dpm_context->dpm_tables.uclk_table);
2229+
ret = smu_v13_0_6_set_soft_freq_limited_range(smu,
2230+
SMU_UCLK, min_clk,
2231+
max_clk, false);
2232+
if (ret)
2233+
return ret;
2234+
}
22322235
smu_v13_0_reset_custom_level(smu);
22332236
}
22342237
break;

0 commit comments

Comments
 (0)