]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd: Restore cached power limit during resume
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 25 Jul 2025 03:12:21 +0000 (22:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:09 +0000 (16:26 +0200)
commit ed4efe426a49729952b3dc05d20e33b94409bdd1 upstream.

The power limit will be cached in smu->current_power_limit but
if the ASIC goes into S3 this value won't be restored.

Restore the value during SMU resume.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250725031222.3015095-2-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 26a609e053a6fc494403e95403bc6a2470383bec)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index 537285f255ab9fe0fc8ab46431f61ef181c0568b..3d7f34a55180a5647bdfc932a37b99a35c951564 100644 (file)
@@ -1738,6 +1738,12 @@ static int smu_resume(void *handle)
 
        adev->pm.dpm_enabled = true;
 
+       if (smu->current_power_limit) {
+               ret = smu_set_power_limit(smu, smu->current_power_limit);
+               if (ret && ret != -EOPNOTSUPP)
+                       return ret;
+       }
+
        dev_info(adev->dev, "SMU is resumed successfully!\n");
 
        return 0;