<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; color: rgb(0, 0, 0);">Reviewed-by: Alex Deucher <alexander.deucher@amd.com></span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Liang, Prike <Prike.Liang@amd.com><br>
<b>Sent:</b> Thursday, November 16, 2023 10:35 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Liang, Prike <Prike.Liang@amd.com><br>
<b>Subject:</b> [PATCH v2] drm/amdgpu: correct the amdgpu runtime dereference usage count</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Fix the amdgpu runpm dereference usage count.<br>
<br>
Signed-off-by: Prike Liang <Prike.Liang@amd.com><br>
---<br>
v2: remove goto clause and return directly(Alex)<br>
<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +++------<br>
 1 file changed, 3 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br>
index 0cacd0b9f8be..b8fbe97efe1d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c<br>
@@ -340,14 +340,11 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,<br>
                 adev->have_disp_power_ref = true;<br>
                 return ret;<br>
         }<br>
-       /* if we have no active crtcs, then drop the power ref<br>
-        * we got before<br>
+       /* if we have no active crtcs, then go to<br>
+        * drop the power ref we got before<br>
          */<br>
-       if (!active && adev->have_disp_power_ref) {<br>
-               pm_runtime_put_autosuspend(dev->dev);<br>
+       if (!active && adev->have_disp_power_ref)<br>
                 adev->have_disp_power_ref = false;<br>
-       }<br>
-<br>
 out:<br>
         /* drop the power reference we got coming in here */<br>
         pm_runtime_put_autosuspend(dev->dev);<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>