[PATCH v2] drm/amdgpu: correct the amdgpu runtime dereference usage count

Deucher, Alexander Alexander.Deucher at amd.com
Fri Nov 17 04:24:59 UTC 2023


[AMD Official Use Only - General]

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: Liang, Prike <Prike.Liang at amd.com>
Sent: Thursday, November 16, 2023 10:35 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Li, Sun peng (Leo) <Sunpeng.Li at amd.com>; Wentland, Harry <Harry.Wentland at amd.com>; Feng, Kenneth <Kenneth.Feng at amd.com>; Liang, Prike <Prike.Liang at amd.com>
Subject: [PATCH v2] drm/amdgpu: correct the amdgpu runtime dereference usage count

Fix the amdgpu runpm dereference usage count.

Signed-off-by: Prike Liang <Prike.Liang at amd.com>
---
v2: remove goto clause and return directly(Alex)

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++------
 1 file 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 0cacd0b9f8be..b8fbe97efe1d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -340,14 +340,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);
--
2.34.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20231117/822fd31b/attachment.htm>


More information about the amd-gfx mailing list