summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrike Liang <Prike.Liang@amd.com>2023-11-08 09:38:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-12-13 20:27:04 +0300
commitd4fb20dcc13b37ee4f02025cd1dc8054d6027721 (patch)
tree35e634b84c70ff58ad9de4bc731725ca0033ede1
parentb5862e5ca58f55649117ebd5488cf6eefe4dc652 (diff)
downloadlinux-d4fb20dcc13b37ee4f02025cd1dc8054d6027721.tar.xz
drm/amdgpu: correct the amdgpu runtime dereference usage count
[ Upstream commit c6df7f313794c3ad41a49b9a7c95da369db607f3 ] Fix the amdgpu runpm dereference usage count. Signed-off-by: Prike Liang <Prike.Liang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_display.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 7cc7af2a6822..3671a700189d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -299,13 +299,11 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
adev->have_disp_power_ref = true;
return ret;
}
- /* if we have no active crtcs, then drop the power ref
- we got before */
- if (!active && adev->have_disp_power_ref) {
- pm_runtime_put_autosuspend(dev->dev);
+ /* if we have no active crtcs, then go to
+ * drop the power ref we got before
+ */
+ if (!active && adev->have_disp_power_ref)
adev->have_disp_power_ref = false;
- }
-
out:
/* drop the power reference we got coming in here */
pm_runtime_put_autosuspend(dev->dev);