<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:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Lee Starnes just sent the exact same patch yesterday. Please review that one:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://patchwork.freedesktop.org/patch/399497/" id="LPlnk260581">https://patchwork.freedesktop.org/patch/399497/</a><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</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> Wentland, Harry <Harry.Wentland@amd.com><br>
<b>Sent:</b> Tuesday, November 10, 2020 9:27 AM<br>
<b>To:</b> Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amd/display: Fix memory leaks in S3 resume</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 2020-11-10 2:49 a.m., Stylon Wang wrote:<br>
> EDID parsing in S3 resume pushes new display modes<br>
> to probed_modes list but doesn't consolidate to actual<br>
> mode list. This creates a race condition when<br>
> amdgpu_dm_connector_ddc_get_modes() re-initializes the<br>
> list head without walking the list and results in memory leak.<br>
> <br>
> Signed-off-by: Stylon Wang <stylon.wang@amd.com><br>
<br>
Looks reasonable to me but haven't had a chance to understand whether <br>
this is the best solution.<br>
<br>
Acked-by: Harry Wentland <harry.wentland@amd.com><br>
<br>
Harry<br>
<br>
> ---<br>
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-<br>
> 1 file changed, 2 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> index 0b6adf23d316..715e0bd489f8 100644<br>
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
> @@ -2337,7 +2337,8 @@ void amdgpu_dm_update_connector_after_detect(<br>
> <br>
> drm_connector_update_edid_property(connector,<br>
> aconnector->edid);<br>
> - drm_add_edid_modes(connector, aconnector->edid);<br>
> + aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid);<br>
> + drm_connector_list_update(connector);<br>
> <br>
> if (aconnector->dc_link->aux_mode)<br>
> drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,<br>
> <br>
</div>
</span></font></div>
</div>
</body>
</html>