A GPU reset reinitialises PMFW, which comes back on its default curve, but
smu_dpm.dpm_level still holds the level the user forced. sysfs keeps
reporting that level while the hardware runs at the default one. On an SMU
14.0.1 APU gfxclk drops from 2.8GHz to 600MHz while sysfs still reports
high.

The stale value also stops the user from recovering, as writing the same
level again is dropped by amdgpu_dpm_force_performance_level().

Reset the cached level once PMFW has been reinitialised, so that it
describes the hardware. Suspend/resume is not covered, as PMFW retains its
state across s2idle.

Signed-off-by: Priya Hosur <[email protected]>
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c 
b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index a65aa2129845..371f1b1b383d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -998,6 +998,10 @@ static int smu_late_init(struct amdgpu_ip_block *ip_block)
 
        smu_get_fan_parameters(smu);
 
+       /* PMFW is reinitialised by the reset, so the cached level must follow 
*/
+       if (amdgpu_reset_in_recovery(adev))
+               smu->smu_dpm.dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
+
        smu_handle_task(smu,
                        smu->smu_dpm.dpm_level,
                        AMD_PP_TASK_COMPLETE_INIT);
-- 
2.43.0

Reply via email to