From: Christian König Date: Mon, 29 Feb 2016 15:53:11 +0000 (-0500) Subject: dma-buf/fence: fix fence_is_later v2 X-Git-Tag: v5.15~13554^2~67^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b47bcb93bbf201e9c5af698945755efeb60c0bc8;p=platform%2Fkernel%2Flinux-starfive.git dma-buf/fence: fix fence_is_later v2 A fence is never later than itself. This caused a bunch of overhead for AMDGPU. v2: simplify check as suggested by Michel. Signed-off-by: Christian König Reviewed-by: Michel Dänzer Reviewed-by: Alex Deucher Reviewed-by: Gustavo Padovan Reviewed-by: Maarten Lankhorst Signed-off-by: Alex Deucher Signed-off-by: Sumit Semwal Signed-off-by: Daniel Vetter --- diff --git a/include/linux/fence.h b/include/linux/fence.h index bb52201..5aa95eb 100644 --- a/include/linux/fence.h +++ b/include/linux/fence.h @@ -292,7 +292,7 @@ static inline bool fence_is_later(struct fence *f1, struct fence *f2) if (WARN_ON(f1->context != f2->context)) return false; - return f1->seqno - f2->seqno < INT_MAX; + return (int)(f1->seqno - f2->seqno) > 0; } /**