drm/amd/pm: restore the forced performance level after a reset
Subsystems (3)
v2 cover drm/amd/pm: restore the forced performance level after a reset
After a GPU reset the level reported through power_dpm_force_performance_level no longer matches the hardware. The reset reinitialises PMFW, which comes back on its default curve, while smu_dpm.dpm_level still holds the level the user forced.
On an SMU 14.0.1 APU this shows up as gfxclk dropping from 2.8GHz to 600MHz while sysfs still reports high, with no thermal or power event involved:
before level: high freq: 2799000000
amdgpu 0000:c5:00.0: MODE2 reset
amdgpu 0000:c5:00.0: SMU is resumed successfully!after level: high freq: 600000000
smu_late_init() already tries to re-apply the level after the reset:
smu_handle_task(smu, smu->smu_dpm.dpm_level, AMD_PP_TASK_COMPLETE_INIT);
but smu_adjust_power_state_dynamic() only programs the hardware when
if (smu_dpm_ctx->dpm_level != level)
and smu_dpm_ctx is &smu->smu_dpm, so the level is compared against itself. The branch is never taken for this caller and smu_asic_set_performance_level() is never called.
Syncing the cached level with the state PMFW came back in, before re-applying the forced level, makes that call effective again. The reset then no longer changes the level the user asked for.
Tested on an SMU 14.0.1 APU, triggering resets through debugfs/amdgpu_gpu_recover and reading the level and gfxclk either side:
level before reset 1 reset 2 reset 3 high 2784MHz 2799MHz 2799MHz 2799MHz low 605MHz 600MHz 600MHz manual 600MHz 600MHz 603MHz profile_peak 2260MHz 2799MHz 2799MHz profile_standard 705MHz 700MHz 700MHz auto 600MHz 601MHz 600MHz 600MHz
The level is retained across every reset, with no drift over repeats, and auto is left on its own curve rather than being pinned high. profile_peak sets a ceiling rather than a floor, so its sampled clock varies with load. 17 MODE2 resets over the run with no instability.
A suspend/resume cycle also keeps the level: high at 2784MHz before suspend, high at 2799MHz after resume.
The change is scoped to reset recovery. PMFW retains its state across s2idle, so on resume the forced level still applies and nothing needs re-applying.
This is the only configuration I have available to test. The change is in generic SMU code, so it applies to every ASIC going through smu_late_init().
v2: restore the forced level instead of reporting the default after the
reset, as the driver is expected to keep the level the user asked for and the reset often goes unnoticed (Lijo)
Priya Hosur (1):
drm/amd/pm: restore the forced performance level after a reset
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.43.0
PATCH v2 1/1 drm/amd/pm: restore the forced performance level after a reset
smu_late_init() re-applies the DPM level after a reset with
smu_handle_task(smu, smu->smu_dpm.dpm_level, AMD_PP_TASK_COMPLETE_INIT);
but smu_adjust_power_state_dynamic() only programs the hardware when
if (smu_dpm_ctx->dpm_level != level)
and smu_dpm_ctx is &smu->smu_dpm, so the level is compared against itself. The branch is never taken for this caller and smu_asic_set_performance_level() is never called.
PMFW is reinitialised by the reset and comes back on its default curve, while smu_dpm.dpm_level still holds the level the user forced. The device therefore runs at the default level while sysfs keeps reporting the forced one. On an SMU 14.0.1 APU gfxclk drops from 2.8GHz to 600MHz while sysfs still reports high. Writing the same level again does not help either, as amdgpu_dpm_force_performance_level() returns early when the requested level matches the cached one.
Sync the cached level with the state PMFW came back in before re-applying the forced level, so that it is programmed again. Suspend/resume is not covered, as PMFW retains its state across s2idle and the forced level still applies on resume.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +12 -3
@@ -998,9 +998,18 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)smu_get_fan_parameters (smu); -smu_handle_task (smu, - smu->smu_dpm.dpm_level, -AMD_PP_TASK_COMPLETE_INIT ); +if (amdgpu_reset_in_recovery (adev)) { +enum amd_dpm_forced_level level = smu->smu_dpm.dpm_level; + +/* PMFW is reinitialised by the reset, so sync the cached level +* before re-applying the forced one +*/ + smu->smu_dpm.dpm_level =AMD_DPM_FORCED_LEVEL_AUTO ; +smu_handle_task (smu, level,AMD_PP_TASK_COMPLETE_INIT ); + }else { +smu_handle_task (smu, smu->smu_dpm.dpm_level, +AMD_PP_TASK_COMPLETE_INIT ); + } ret =smu_apply_default_config_table_settings (smu);if (ret && (ret != -EOPNOTSUPP )) {
Signature · 1 line
2.43.0
AMD General
Hi Team,
Gentle reminder on this patch.
Lijo, v2 follows your feedback to restore the forced level rather than report the default. Could you take a look when you get a chance?
Thanks and Regards,
Priya
-----Original Message-----
From: Priya Hosur <[email protected]>
Sent: Thursday, October 8, 2026 4:10 PM
To: [email protected]; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Hosur, Priya <[email protected]>; Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>
Subject: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a reset
smu_late_init() re-applies the DPM level after a reset with
smu_handle_task(smu, smu->smu_dpm.dpm_level, AMD_PP_TASK_COMPLETE_INIT);
but smu_adjust_power_state_dynamic() only programs the hardware when
if (smu_dpm_ctx->dpm_level != level)
and smu_dpm_ctx is &smu->smu_dpm, so the level is compared against itself. The branch is never taken for this caller and smu_asic_set_performance_level() is never called.
PMFW is reinitialised by the reset and comes back on its default curve, while smu_dpm.dpm_level still holds the level the user forced. The device therefore runs at the default level while sysfs keeps reporting the forced one. On an SMU 14.0.1 APU gfxclk drops from 2.8GHz to 600MHz while sysfs still reports high. Writing the same level again does not help either, as amdgpu_dpm_force_performance_level() returns early when the requested level matches the cached one.
Sync the cached level with the state PMFW came back in before re-applying the forced level, so that it is programmed again. Suspend/resume is not covered, as PMFW retains its state across s2idle and the forced level still applies on resume.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +12 -3
@@ -998,9 +998,18 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)smu_get_fan_parameters (smu); -smu_handle_task (smu, - smu->smu_dpm.dpm_level, -AMD_PP_TASK_COMPLETE_INIT ); +if (amdgpu_reset_in_recovery (adev)) { +enum amd_dpm_forced_level level = smu->smu_dpm.dpm_level; + +/* PMFW is reinitialised by the reset, so sync the cached level +* before re-applying the forced one +*/ + smu->smu_dpm.dpm_level =AMD_DPM_FORCED_LEVEL_AUTO ; +smu_handle_task (smu, level,AMD_PP_TASK_COMPLETE_INIT ); + }else { +smu_handle_task (smu, smu->smu_dpm.dpm_level, +AMD_PP_TASK_COMPLETE_INIT ); + } ret =smu_apply_default_config_table_settings (smu);if (ret && (ret != -EOPNOTSUPP )) {
--
2.43.0
AMD General
Quoted 1 line
Quoted 1 line
[PATCH] drm/amd/pm: reapply umd profile state after recovery
Could you please double check this change? It seems it already covers your case as I see.
Best Regards,
Kevin
Quoted 97 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Hosur, Priya
Sent: Thursday, October 15, 2026 17:47
To: [email protected]; Lazar, Lijo <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>; Hosur, Priya <[email protected]>
Subject: RE: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a resetAMD General
Hi Team,
Gentle reminder on this patch.
Lijo, v2 follows your feedback to restore the forced level rather than report the default. Could you take a look when you get a chance?
Thanks and Regards,
Priya-----Original Message-----
From: Priya Hosur <[email protected]>
Sent: Thursday, October 8, 2026 4:10 PM
To: [email protected]; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Hosur, Priya <[email protected]>; Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>
Subject: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a reset
smu_late_init()re-applies the DPM level after a reset withsmu_handle_task(smu,
smu->smu_dpm.dpm_level,AMD_PP_TASK_COMPLETE_INIT);but
smu_adjust_power_state_dynamic()only programs the hardware whenif (
smu_dpm_ctx->dpm_level!= level)and
smu_dpm_ctxis&smu->smu_dpm, so the level is compared against itself. The branch is never taken for this caller andsmu_asic_set_performance_level()is never called.PMFW is reinitialised by the reset and comes back on its default curve, while smu_dpm.dpm_level still holds the level the user forced. The device therefore runs at the default level while sysfs keeps reporting the forced one. On an SMU 14.0.1 APU gfxclk drops from 2.8GHz to 600MHz while sysfs still reports high. Writing the same level again does not help either, as
amdgpu_dpm_force_performance_level()returns early when the requested level matches the cached one.Sync the cached level with the state PMFW came back in before re-applying the forced level, so that it is programmed again. Suspend/resume is not covered, as PMFW retains its state across s2idle and the forced level still applies on resume.
Signed-off-by Priya Hosur <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +13
-4@@ -998,9 +998,18 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)smu_get_fan_parameters (smu); -smu_handle_task (smu, - smu->smu_dpm.dpm_level, -AMD_PP_TASK_COMPLETE_INIT ); +if (amdgpu_reset_in_recovery (adev)) { +enum amd_dpm_forced_level level = + smu->smu_dpm.dpm_level; + +/* PMFW is reinitialised by the reset, so sync the cached level +* before re-applying the forced one +*/ + smu->smu_dpm.dpm_level =AMD_DPM_FORCED_LEVEL_AUTO ; +smu_handle_task (smu, level,AMD_PP_TASK_COMPLETE_INIT ); + }else { +smu_handle_task (smu, smu->smu_dpm.dpm_level, +AMD_PP_TASK_COMPLETE_INIT ); + } ret =smu_apply_default_config_table_settings (smu);if (ret && (ret != -EOPNOTSUPP )) { --2.43.0
AMD General
Hi Kevin,
Thanks, I checked that patch.
It gates on the UMD profile levels:
case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK:
case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK:
break;
default:
ret = 0;
goto unlock;in amdgpu_dpm_reapply_umd_profile(), and the same switch in smu_reapply_performance_level() returns -EINVAL for default.
The reported issue is with power_dpm_force_performance_level set to high, which is AMD_DPM_FORCED_LEVEL_HIGH, so it takes the default path. low and manual are the same.
AMD_PP_TASK_COMPLETE_INIT also still passes force_performance_level = false:
case AMD_PP_TASK_COMPLETE_INIT:
ret = smu_adjust_power_state_dynamic(smu, level, true, false);so the behaviour of the smu_late_init() path is unchanged.
My patch makes that path re-apply the retained level after a reset. Tested on an SMU 14.0.1 APU with high set: gfxclk 2784MHz before the reset and 2799MHz after. Without the patch it drops to 600MHz.
Thanks and Regards,
Priya Hosur
-----Original Message-----
From: Wang, Kevin <[email protected]>
Sent: Thursday, October 15, 2026 3:55 PM
To: Hosur, Priya <[email protected]>; [email protected]; Lazar, Lijo <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>; Hosur, Priya <[email protected]>
Subject: RE: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a reset
AMD General
Quoted 1 line
Quoted 1 line
[PATCH] drm/amd/pm: reapply umd profile state after recovery
Could you please double check this change? It seems it already covers your case as I see.
Best Regards,
Kevin
Quoted 100 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Hosur, Priya
Sent: Thursday, October 15, 2026 17:47
To: [email protected]; Lazar, Lijo <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>; Hosur, Priya <[email protected]>
Subject: RE: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a resetAMD General
Hi Team,
Gentle reminder on this patch.
Lijo, v2 follows your feedback to restore the forced level rather than report the default. Could you take a look when you get a chance?
Thanks and Regards,
Priya-----Original Message-----
From: Priya Hosur <[email protected]>
Sent: Thursday, October 8, 2026 4:10 PM
To: [email protected]; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Hosur, Priya <[email protected]>; Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>
Subject: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a reset
smu_late_init()re-applies the DPM level after a reset withsmu_handle_task(smu,
smu->smu_dpm.dpm_level,AMD_PP_TASK_COMPLETE_INIT);but
smu_adjust_power_state_dynamic()only programs the hardware whenif (
smu_dpm_ctx->dpm_level!= level)and
smu_dpm_ctxis&smu->smu_dpm, so the level is compared against itself. The branch is never taken for this caller andsmu_asic_set_performance_level()is never called.PMFW is reinitialised by the reset and comes back on its default curve, while smu_dpm.dpm_level still holds the level the user forced. The device therefore runs at the default level while sysfs keeps reporting the forced one. On an SMU 14.0.1 APU gfxclk drops from 2.8GHz to 600MHz while sysfs still reports high. Writing the same level again does not help either, as
amdgpu_dpm_force_performance_level()returns early when the requested level matches the cached one.Sync the cached level with the state PMFW came back in before
re-applying the forced level, so that it is programmed again.
Suspend/resume is not covered, as PMFW retains its state across s2idle and the forced level still applies on resume.Signed-off-by Priya Hosur <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +13
-4@@ -998,9 +998,18 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)smu_get_fan_parameters (smu); -smu_handle_task (smu, - smu->smu_dpm.dpm_level, -AMD_PP_TASK_COMPLETE_INIT ); +if (amdgpu_reset_in_recovery (adev)) { +enum amd_dpm_forced_level level = + smu->smu_dpm.dpm_level; + +/* PMFW is reinitialised by the reset, so sync the cached level +* before re-applying the forced one +*/ + smu->smu_dpm.dpm_level =AMD_DPM_FORCED_LEVEL_AUTO ; +smu_handle_task (smu, level,AMD_PP_TASK_COMPLETE_INIT ); + }else { +smu_handle_task (smu, smu->smu_dpm.dpm_level, +AMD_PP_TASK_COMPLETE_INIT ); + } ret =smu_apply_default_config_table_settings (smu);if (ret && (ret != -EOPNOTSUPP )) { --2.43.0
AMD General
Hi Team,
Gentle reminder on this patch.
Kevin, did you get a chance to look at my reply? The UMD profile reapply path is gated on the PROFILE_* levels, so it does not cover the reported case of power_dpm_force_performance_level set to high.
Lijo, v2 restores the forced level as you suggested. Could you please review?
Thanks and Regards,
Priya
-----Original Message-----
From: Hosur, Priya
Sent: Thursday, October 15, 2026 7:29 PM
To: Wang, Kevin <[email protected]>; [email protected]; Lazar, Lijo <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>
Subject: RE: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a reset
Hi Kevin,
Thanks, I checked that patch.
It gates on the UMD profile levels:
case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK:
case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK:
break;
default:
ret = 0;
goto unlock;in amdgpu_dpm_reapply_umd_profile(), and the same switch in smu_reapply_performance_level() returns -EINVAL for default.
The reported issue is with power_dpm_force_performance_level set to high, which is AMD_DPM_FORCED_LEVEL_HIGH, so it takes the default path. low and manual are the same.
AMD_PP_TASK_COMPLETE_INIT also still passes force_performance_level = false:
case AMD_PP_TASK_COMPLETE_INIT:
ret = smu_adjust_power_state_dynamic(smu, level, true, false);so the behaviour of the smu_late_init() path is unchanged.
My patch makes that path re-apply the retained level after a reset.
Tested on an SMU 14.0.1 APU with high set: gfxclk 2784MHz before the reset and 2799MHz after. Without the patch it drops to 600MHz.
Thanks and Regards,
Priya Hosur
-----Original Message-----
From: Wang, Kevin <[email protected]>
Sent: Thursday, October 15, 2026 3:55 PM
To: Hosur, Priya <[email protected]>; [email protected]; Lazar, Lijo <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>; Hosur, Priya <[email protected]>
Subject: RE: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a reset
AMD General
Quoted 1 line
Quoted 1 line
[PATCH] drm/amd/pm: reapply umd profile state after recovery
Could you please double check this change? It seems it already covers your case as I see.
Best Regards,
Kevin
Quoted 100 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Hosur, Priya
Sent: Thursday, October 15, 2026 17:47
To: [email protected]; Lazar, Lijo <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>; Hosur, Priya <[email protected]>
Subject: RE: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a resetAMD General
Hi Team,
Gentle reminder on this patch.
Lijo, v2 follows your feedback to restore the forced level rather than report the default. Could you take a look when you get a chance?
Thanks and Regards,
Priya-----Original Message-----
From: Priya Hosur <[email protected]>
Sent: Thursday, October 8, 2026 4:10 PM
To: [email protected]; Deucher, Alexander <[email protected]>; Lazar, Lijo <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>
Cc: Hosur, Priya <[email protected]>; Vishwakarma, Pratik <[email protected]>; Gopalakrishnan, Veerabadhran (Veera) <[email protected]>
Subject: [PATCH v2 1/1] drm/amd/pm: restore the forced performance level after a reset
smu_late_init()re-applies the DPM level after a reset withsmu_handle_task(smu,
smu->smu_dpm.dpm_level,AMD_PP_TASK_COMPLETE_INIT);but
smu_adjust_power_state_dynamic()only programs the hardware whenif (
smu_dpm_ctx->dpm_level!= level)and
smu_dpm_ctxis&smu->smu_dpm, so the level is compared against itself. The branch is never taken for this caller andsmu_asic_set_performance_level()is never called.PMFW is reinitialised by the reset and comes back on its default curve, while smu_dpm.dpm_level still holds the level the user forced. The device therefore runs at the default level while sysfs keeps reporting the forced one. On an SMU 14.0.1 APU gfxclk drops from 2.8GHz to 600MHz while sysfs still reports high. Writing the same level again does not help either, as
amdgpu_dpm_force_performance_level()returns early when the requested level matches the cached one.Sync the cached level with the state PMFW came back in before
re-applying the forced level, so that it is programmed again.
Suspend/resume is not covered, as PMFW retains its state across s2idle and the forced level still applies on resume.Signed-off-by Priya Hosur <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +13
-4@@ -998,9 +998,18 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)smu_get_fan_parameters (smu); -smu_handle_task (smu, - smu->smu_dpm.dpm_level, -AMD_PP_TASK_COMPLETE_INIT ); +if (amdgpu_reset_in_recovery (adev)) { +enum amd_dpm_forced_level level = + smu->smu_dpm.dpm_level; + +/* PMFW is reinitialised by the reset, so sync the cached level +* before re-applying the forced one +*/ + smu->smu_dpm.dpm_level =AMD_DPM_FORCED_LEVEL_AUTO ; +smu_handle_task (smu, level,AMD_PP_TASK_COMPLETE_INIT ); + }else { +smu_handle_task (smu, smu->smu_dpm.dpm_level, +AMD_PP_TASK_COMPLETE_INIT ); + } ret =smu_apply_default_config_table_settings (smu);if (ret && (ret != -EOPNOTSUPP )) { --2.43.0