]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: correct the amdgpu runtime dereference usage count
authorPrike Liang <Prike.Liang@amd.com>
Wed, 8 Nov 2023 06:38:29 +0000 (14:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:36:48 +0000 (18:36 +0100)
[ 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>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index 2952f897344879e68a35c8c82d9628f0b447d6b3..11413b3e80c5bb4e0568b45b32d9294fb440da6d 100644 (file)
@@ -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);