From: Pierre-Eric Pelloux-Prayer Date: Fri, 26 Jul 2024 09:42:40 +0000 (+0200) Subject: drm/amd/pm: fix rpm refcount handling on error X-Git-Tag: v6.13-rc1~122^2~15^2~171 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0fca3275526db94e64106fa86473bb3a8ea795f;p=thirdparty%2Flinux.git drm/amd/pm: fix rpm refcount handling on error pm_runtime_put_autosuspend must be called from all exit paths. Tested-by: Mario Limonciello Reviewed-by: Kenneth Feng Signed-off-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index d5d6ab484e5ad..485672f3d6c5c 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -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; }