]> 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:31:02 +0000 (16:31 +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 3fd8da5dc761ef4256c2cb1a05f26104e491896b..b6657abe62fc4cd8661c9edf83a961b749071ca4 100644 (file)
@@ -2153,6 +2153,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;