All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/1] drm/amd/pm: restore the forced performance level after a reset
@ 2026-11-03 10:28 Priya Hosur
  2026-11-03 10:28 ` [PATCH v3 1/1] " Priya Hosur
  0 siblings, 1 reply; 6+ messages in thread
From: Priya Hosur @ 2026-11-03 10:28 UTC (permalink / raw)
  To: amd-gfx, Alexander.Deucher, Lijo.Lazar, Kevin.Wang,
	Christian.Koenig, Felix.Kuehling
  Cc: Priya.Hosur, Veerabadhran.Gopalakrishnan, Pratik.Vishwakarma

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.

smu_late_init() already tries to re-apply the level after the reset through
AMD_PP_TASK_COMPLETE_INIT, but smu_adjust_power_state_dynamic() compares
the cached level against itself and force_performance_level is false for
that task, so the hardware is never programmed.

amdgpu_dpm_reapply_umd_profile() covers the PROFILE_* levels after
recovery, but returns early for high, low and manual.

v3 forces the level to be programmed for AMD_PP_TASK_COMPLETE_INIT during
reset recovery, using the existing force_performance_level argument.

Tested on an SMU 14.0.1 APU (PMFW 100.113.0) on amd-staging-drm-next,
triggering resets through debugfs/amdgpu_gpu_recover and reading the level
and gfxclk before and after each reset:

  without this patch
  level              before    reset 1   reset 2   reset 3
  high               2449MHz    630MHz    600MHz    600MHz

  with this patch
  level              before    reset 1   reset 2   reset 3
  high               2446MHz   2794MHz   2796MHz   2794MHz
  low                1399MHz    604MHz    600MHz    600MHz
  manual              600MHz    600MHz    601MHz    601MHz
  profile_peak       2016MHz   2289MHz   2137MHz   1644MHz
  profile_standard    834MHz    700MHz    700MHz    700MHz
  auto                636MHz    601MHz    600MHz    600MHz

The level is retained across every reset, and auto is left on its own
curve. The "before" sample is taken one second after the level is written.
The profile_peak readings vary from sample to sample both with and without
this patch. 18 MODE2 resets over the run, with no errors in the kernel log.

An s2idle cycle also keeps the level: high at 2667MHz before suspend, high
at 2799MHz after resume.

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().

v3:
  - Use the existing force_performance_level argument of
    smu_adjust_power_state_dynamic() for AMD_PP_TASK_COMPLETE_INIT during
    reset recovery, instead of switching the cached level to AUTO first
  - The cached level is no longer modified, so if programming fails the
    level the user asked for is still retained and the failure is logged
  - Rebased on amd-staging-drm-next, which now includes Kevin's
    "drm/amd/pm: reapply umd profile state after recovery"
  - Explain in the commit message why that path does not cover high,
    low and manual (Kevin's question on v2)
  - Add test results without the patch on the same base

v2:
  - Restore the forced level after the reset instead of reporting the
    default, as the driver is expected to keep the level the user asked
    for and the reset often goes unnoticed (Lijo)
  - Link: https://lore.kernel.org/amd-gfx/20261008104026.4102222-1-Priya.Hosur@amd.com/

v1:
  - Reset the cached level to AUTO after a reset so that sysfs reports the
    level PMFW is actually running at
  - Link: https://lore.kernel.org/amd-gfx/20261007122103.4019578-1-Priya.Hosur@amd.com/

Priya Hosur (1):
  drm/amd/pm: restore the forced performance level after a reset

 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-03 12:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 10:28 [PATCH v3 0/1] drm/amd/pm: restore the forced performance level after a reset Priya Hosur
2026-11-03 10:28 ` [PATCH v3 1/1] " Priya Hosur
2026-11-03 10:41   ` Lazar, Lijo
2026-11-03 10:44     ` Lazar, Lijo
2026-11-03 11:37       ` Wang, Kevin
2026-11-03 12:07         ` Lazar, Lijo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.