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 5D009D116F5 for ; Mon, 1 Dec 2025 13:39:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 957FC10E41A; Mon, 1 Dec 2025 13:39:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=mailbox.org header.i=@mailbox.org header.b="oMA0l5GF"; dkim-atps=neutral Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6980010E7D1; Thu, 27 Nov 2025 09:16:16 +0000 (UTC) Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4dH9ld1kxhz9tZ4; Thu, 27 Nov 2025 10:16:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1764234973; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XFgdH560T3YiZGXpnSavHS2fNWjlZmWfX61HED3oDlY=; b=oMA0l5GF20+89bOALj2AZEzZ3KIYCQ0sQV3nKIuCRZQwgA60GoBHIUvo5JRwMguBCc9aZn F5inZjQemfWXADIy+1xs76rtlYJFo92RNRet6w4peIdc++GW6ttRGWxsCSXZqLLJ1K10VW QLkDmrkejRTh1VxfNJZ4pklrXpAKF9HotuRSmTJqVuPBFkros9P2+ivH/W1otk+mQpr0t9 mnTm79fYRIiStVef/JAOqBwscFVop7s6hLDvpyU/Arc28NFYHaNpXsDjbYT9vMO0+bOAVO gzwkxgjeZWdYc3mg70heVVNEMMx2BkFm+1Edzdqkw9Qv9hGCakXTyIbg4+8BCQ== Message-ID: <35189892c0cb774155e2012d41371b4d3f8e7d0f.camel@mailbox.org> Subject: Re: [PATCH 1/6] dma-buf/dma-fence: Add dma_fence_test_signaled_flag() From: Philipp Stanner To: Christian =?ISO-8859-1?Q?K=F6nig?= , Matthew Brost , Philipp Stanner Cc: Sumit Semwal , Gustavo Padovan , Felix Kuehling , Alex Deucher , David Airlie , Simona Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Huang Rui , Matthew Auld , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas De Marchi , Thomas =?ISO-8859-1?Q?Hellstr=F6m?= , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, rust-for-linux@vger.kernel.org, Tvrtko Ursulin Date: Thu, 27 Nov 2025 10:16:01 +0100 In-Reply-To: References: <20251126131914.149445-2-phasta@kernel.org> <20251126131914.149445-3-phasta@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MBO-RS-META: bgpghhhhrg9u5u445qr6ka3upg67j9jx X-MBO-RS-ID: a7092e291bad71bbc06 X-Mailman-Approved-At: Mon, 01 Dec 2025 13:39:28 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: phasta@kernel.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, 2025-11-27 at 09:11 +0100, Christian K=C3=B6nig wrote: > On 11/26/25 17:55, Matthew Brost wrote: > > On Wed, Nov 26, 2025 at 08:41:27AM -0800, Matthew Brost wrote: > > > On Wed, Nov 26, 2025 at 02:19:10PM +0100, Philipp Stanner wrote: > > > > The dma_fence framework checks at many places whether the signaled = flag > > > > of a fence is already set. The code can be simplified and made more > > > > readable by providing a helper function for that. > > > >=20 > > > > Add dma_fence_test_signaled_flag(), which only checks whether a fen= ce is > > > > signaled. Use it internally. > > > >=20 > > > > Suggested-by: Tvrtko Ursulin > > > > Signed-off-by: Philipp Stanner > > >=20 > > > This is a nice cleanp: > > > Reviewed-by: Matthew Brost > > >=20 > > > > --- > > > > =C2=A0drivers/dma-buf/dma-fence.c | 19 +++++++++---------- > > > > =C2=A0include/linux/dma-fence.h=C2=A0=C2=A0 | 24 ++++++++++++++++++= ++++-- > > > > =C2=A02 files changed, 31 insertions(+), 12 deletions(-) > > > >=20 > > > > diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fenc= e.c > > > > index 39e6f93dc310..25117a906846 100644 > > > > --- a/drivers/dma-buf/dma-fence.c > > > > +++ b/drivers/dma-buf/dma-fence.c > > > > @@ -372,8 +372,7 @@ int dma_fence_signal_timestamp_locked(struct dm= a_fence *fence, > > > > =C2=A0 > > > > =C2=A0 lockdep_assert_held(fence->lock); > > > > =C2=A0 > > > > - if (unlikely(test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, > > > > - =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 &fence->flags))) > >=20 > > I need to read a little better, I think this change isn't quite right. > > The original code is test and set, the updated code is test only (i.e., > > you are missing the set step). So maybe just leave this line as is. >=20 > Oh, good point! I've totally missed that as well. Oh dear; I also just saw it when opening the mail client ._. >=20 > But that means that this patch set hasn't even been smoke tested. I've built it and did some basic testing with my Nouveau system. Any suggestions? Do you have a CI that one can trigger? Thx P.