From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C843EDF15B for ; Fri, 13 Feb 2026 14:33:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F00E010E811; Fri, 13 Feb 2026 14:33:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="XI6++OgG"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEED710E811 for ; Fri, 13 Feb 2026 14:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1770993235; bh=QrHRsIhrdBDLSHjhctyMWK0PdAzEwhDoDqFh8NUhPsg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XI6++OgGhAoR6cPGMc0s+GhabfCA3WYXjfjwg01BIqPa57q2uQ3WUh+tXkBJYKEWq vFyN5mSGWcvY9VaJIz3x+u7DNfiSjkE3CfQAhmL+vOurN3rlKb0Liyz3WPvbqzGCAL 6rD7OgsIklF3bnc6y8/znn+ESHFfpvM6SZMNUyRwRIoUdEU10W/XeB1YRe36gir8lu v5QMK7fQwCtEO4WXzQqSZUp6cng4qkIoU3DYs9kjfkoMFag+WulLdP8hlFRz3zEbYi 3A2bKOPjdVZFYGZIjfznaLGCg/j5g1cBeqJxTyExSbAhCjGi3VbJL1byAHSc3YZLV6 DY3LInsRlTq7A== Received: from fedora (unknown [IPv6:2a01:e0a:2c:6930:d919:a6e:5ea1:8a9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 52EA117E00AC; Fri, 13 Feb 2026 15:33:55 +0100 (CET) Date: Fri, 13 Feb 2026 15:33:50 +0100 From: Boris Brezillon To: "Christian =?UTF-8?B?S8O2bmln?=" Cc: phasta@mailbox.org, matthew.brost@intel.com, sumit.semwal@linaro.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH 8/8] dma-buf: use inline lock for the dma-fence-chain Message-ID: <20260213153350.223cd382@fedora> In-Reply-To: <20260210102232.1642-9-christian.koenig@amd.com> References: <20260210102232.1642-1-christian.koenig@amd.com> <20260210102232.1642-9-christian.koenig@amd.com> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 10 Feb 2026 11:02:03 +0100 "Christian K=C3=B6nig" wrote: > Using the inline lock is now the recommended way for dma_fence > implementations. >=20 > So use this approach for the framework's internal fences as well. >=20 > Also saves about 4 bytes for the external spinlock. >=20 > Signed-off-by: Christian K=C3=B6nig > Reviewed-by: Tvrtko Ursulin > Reviewed-by: Philipp Stanner Reviewed-by: Boris Brezillon > --- > drivers/dma-buf/dma-fence-chain.c | 3 +-- > include/linux/dma-fence-chain.h | 1 - > 2 files changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fenc= e-chain.c > index a8a90acf4f34..a707792b6025 100644 > --- a/drivers/dma-buf/dma-fence-chain.c > +++ b/drivers/dma-buf/dma-fence-chain.c > @@ -245,7 +245,6 @@ void dma_fence_chain_init(struct dma_fence_chain *cha= in, > struct dma_fence_chain *prev_chain =3D to_dma_fence_chain(prev); > uint64_t context; > =20 > - spin_lock_init(&chain->lock); > rcu_assign_pointer(chain->prev, prev); > chain->fence =3D fence; > chain->prev_seqno =3D 0; > @@ -261,7 +260,7 @@ void dma_fence_chain_init(struct dma_fence_chain *cha= in, > seqno =3D max(prev->seqno, seqno); > } > =20 > - dma_fence_init64(&chain->base, &dma_fence_chain_ops, &chain->lock, > + dma_fence_init64(&chain->base, &dma_fence_chain_ops, NULL, > context, seqno); > =20 > /* > diff --git a/include/linux/dma-fence-chain.h b/include/linux/dma-fence-ch= ain.h > index 68c3c1e41014..d39ce7a2e599 100644 > --- a/include/linux/dma-fence-chain.h > +++ b/include/linux/dma-fence-chain.h > @@ -46,7 +46,6 @@ struct dma_fence_chain { > */ > struct irq_work work; > }; > - spinlock_t lock; > }; > =20 > =20