Skip to content

Commit c97636c

Browse files
superm1gregkh
authored andcommitted
drm/amd: Restore cached manual clock settings during resume
[ Upstream commit 796ff8a ] If the SCLK limits have been set before S3 they will not be restored. The limits are however cached in the driver and so they can be restored by running a commit sequence during resume. Acked-by: Alex Deucher <alexander.deucher@amd.com> Link: https://lore.kernel.org/r/20250725031222.3015095-3-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 4e95269) Cc: stable@vger.kernel.org [ Adjust context ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f875c3d commit c97636c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ static void smu_power_profile_mode_get(struct smu_context *smu,
7676
enum PP_SMC_POWER_PROFILE profile_mode);
7777
static void smu_power_profile_mode_put(struct smu_context *smu,
7878
enum PP_SMC_POWER_PROFILE profile_mode);
79+
static int smu_od_edit_dpm_table(void *handle,
80+
enum PP_OD_DPM_TABLE_COMMAND type,
81+
long *input, uint32_t size);
7982

8083
static int smu_sys_get_pp_feature_mask(void *handle,
8184
char *buf)
@@ -2144,6 +2147,7 @@ static int smu_resume(struct amdgpu_ip_block *ip_block)
21442147
int ret;
21452148
struct amdgpu_device *adev = ip_block->adev;
21462149
struct smu_context *smu = adev->powerplay.pp_handle;
2150+
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
21472151

21482152
if (amdgpu_sriov_multi_vf_mode(adev))
21492153
return 0;
@@ -2181,6 +2185,12 @@ static int smu_resume(struct amdgpu_ip_block *ip_block)
21812185
return ret;
21822186
}
21832187

2188+
if (smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL) {
2189+
ret = smu_od_edit_dpm_table(smu, PP_OD_COMMIT_DPM_TABLE, NULL, 0);
2190+
if (ret)
2191+
return ret;
2192+
}
2193+
21842194
dev_info(adev->dev, "SMU is resumed successfully!\n");
21852195

21862196
return 0;

0 commit comments

Comments
 (0)