<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Thursday, November 29, 2018 11:20:12 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org<br>
<b>Cc:</b> maraeo@gmail.com<br>
<b>Subject:</b> [PATCH] drm/ttm: fix LRU handling in ttm_buffer_object_transfer</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">We need to set the NO_EVICT flag on the ghost object or otherwise we are<br>
adding it to the LRU.<br>
<br>
When it is added to the LRU we can run into a race between destroying<br>
and evicting it again.<br>
<br>
Signed-off-by: Christian König <christian.koenig@amd.com><br>
---<br>
 drivers/gpu/drm/ttm/ttm_bo_util.c | 4 +++-<br>
 1 file changed, 3 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c<br>
index ba80150d1052..895d77d799e4 100644<br>
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c<br>
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c<br>
@@ -492,8 +492,10 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,<br>
         if (!fbo)<br>
                 return -ENOMEM;<br>
 <br>
-       ttm_bo_get(bo);<br>
         fbo->base = *bo;<br>
+       fbo->base.mem.placement |= TTM_PL_FLAG_NO_EVICT;<br>
+<br>
+       ttm_bo_get(bo);<br>
         fbo->bo = bo;<br>
 <br>
         /**<br>
-- <br>
2.14.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>