summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrike Liang <Prike.Liang@amd.com>2023-11-08 14:38:29 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-12-13 18:36:48 +0100
commitf7a0cab502f594b1295a2c24eb9f40e8c5d13d9d (patch)
tree9c85bcf4763d7ed8232075beb78ada3a6778bcb5
parent091c77c287b49cf879fe7b019f8a64daa9cb12ac (diff)
downloadlinux-f7a0cab502f594b1295a2c24eb9f40e8c5d13d9d.tar.gz
linux-f7a0cab502f594b1295a2c24eb9f40e8c5d13d9d.tar.bz2
linux-f7a0cab502f594b1295a2c24eb9f40e8c5d13d9d.zip
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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 2952f8973448..11413b3e80c5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -296,14 +296,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 we have no active crtcs, then go to
+ * drop the power ref we got before
*/
- if (!active && adev->have_disp_power_ref) {
- pm_runtime_put_autosuspend(dev->dev);
+ 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);