Skip to contentSkip to conversation

drm/amdgpu: correct the amdgpu runtime dereference usage count

PATCH In review Prike Liang 2 participants 2 messages Nov 17, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

Fix the amdgpu runpm dereference usage count.

---
v2: remove goto clause and return directly(Alex)

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3 -6
index 0cacd0b9f8be..b8fbe97efe1d 100644
@@ -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);
Signature · 1 line
2.34.1
maintainer Reviewed-by on v2 1/1
#1 lore raw

[AMD Official Use Only - General]

________________________________
From: Liang, Prike <[email protected]>
Sent: Thursday, November 16, 2023 10:35 PM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Feng, Kenneth <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH v2] drm/amdgpu: correct the amdgpu runtime dereference usage count

Fix the amdgpu runpm dereference usage count.

---
v2: remove goto clause and return directly(Alex)

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3 -6
index 0cacd0b9f8be..b8fbe97efe1d 100644
@@ -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