<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">
<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">why? is there a design doc mentioned for this on reservation ?</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> Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Tuesday, March 6, 2018 4:03:39 PM<br>
<b>To:</b> Liu, Monk; dri-devel@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] dma-buf/reservation: should keep the new fence in add_shared_inplace</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">NAK, the newly added fence must always be newer than the existing one.<br>
<br>
Christian.<br>
<br>
Am 06.03.2018 um 04:09 schrieb Monk Liu:<br>
> Change-Id: If6a979ba9fd6c923b82212f35f07a9ff31c86767<br>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com><br>
> ---<br>
> drivers/dma-buf/reservation.c | 2 +-<br>
> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c<br>
> index 314eb10..29b7e45 100644<br>
> --- a/drivers/dma-buf/reservation.c<br>
> +++ b/drivers/dma-buf/reservation.c<br>
> @@ -118,7 +118,7 @@ reservation_object_add_shared_inplace(struct reservation_object *obj,<br>
> old_fence = rcu_dereference_protected(fobj->shared[i],<br>
> reservation_object_held(obj));<br>
> <br>
> - if (old_fence->context == fence->context) {<br>
> + if (dma_fence_is_later(fence, old_fence)) {<br>
> /* memory barrier is added by write_seqcount_begin */<br>
> RCU_INIT_POINTER(fobj->shared[i], fence);<br>
> write_seqcount_end(&obj->seq);<br>
<br>
</div>
</span></font></div>
</body>
</html>