]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/pm: fix rpm refcount handling on error
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 26 Jul 2024 09:42:40 +0000 (11:42 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Oct 2024 18:02:05 +0000 (14:02 -0400)
pm_runtime_put_autosuspend must be called from all exit paths.

Tested-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c

index d5d6ab484e5add38c925287527e8378663ed7147..485672f3d6c5c2649cd62ced4de2a4d2cc1f45ed 100644 (file)
@@ -1815,6 +1815,8 @@ static ssize_t amdgpu_set_apu_thermal_cap(struct device *dev,
 
        ret = amdgpu_dpm_set_apu_thermal_limit(adev, value);
        if (ret) {
+               pm_runtime_mark_last_busy(ddev->dev);
+               pm_runtime_put_autosuspend(ddev->dev);
                dev_err(dev, "failed to update thermal limit\n");
                return ret;
        }