Skip to contentSkip to conversation

drm/amdgpu: correct the amdgpu runtime dereference usage count

PATCH Superseded Prike Liang 2 participants 3 messages Nov 14, 2023 – Nov 17, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

Fix the amdgpu runpm dereference usage count.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3 -3
index 0cacd0b9f8be..4737ada467cc 100644
@@ -340,12 +340,12 @@ 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);
 		adev->have_disp_power_ref = false;
+		goto out;
 	}
 
 out:
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - General]

Ping for the review.

Regards,
--Prike

Quoted 40 lines

-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Tuesday, November 14, 2023 10:41 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH] drm/amdgpu: correct the amdgpu runtime dereference usage count

Fix the amdgpu runpm dereference usage count.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3 -3
index 0cacd0b9f8be..4737ada467cc 100644
@@ -340,12 +340,12 @@ 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);
              adev->have_disp_power_ref = false;
+             goto out;
      }
 

out:
--
2.34.1

Reviewed-by
#2 lore raw

[AMD Official Use Only - General]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Liang, Prike
Sent: Friday, November 17, 2023 9:37 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: correct the amdgpu runtime dereference usage count

[AMD Official Use Only - General]

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

[AMD Official Use Only - General]

Ping for the review.

Regards,
--Prike

Quoted 40 lines

-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Tuesday, November 14, 2023 10:41 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH] drm/amdgpu: correct the amdgpu runtime dereference usage count

Fix the amdgpu runpm dereference usage count.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3 -3
index 0cacd0b9f8be..4737ada467cc 100644
@@ -340,12 +340,12 @@ 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);
              adev->have_disp_power_ref = false;
+             goto out;
      }
 

out:
--
2.34.1