From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61B3C25E44F for ; Wed, 9 Apr 2025 12:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744202374; cv=none; b=VBdJhicV0SpPDBNAafT6+ihJ2O42wXO5sBWcSDGfcFH1cNiLyoVih6+j1gUztlL7bQuB9w4gLhgiYNiSmBtvsz+ELcTEjgDOQFRx4gnrQY2qInbjffPDZ3OOjqyssmLXRxytdR7tpW7EUxzA/37twwGQmOOnClBbtzmql05gRfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744202374; c=relaxed/simple; bh=aC6H39PURz2QUDBngdSNG8br7W7dWUtEUshtsY93R/Q=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RTyfOiklWtY2s0kPqwP17QzIpPlVRU4RYrXMiuDNgPdO1KSKKB8vR9+ToB+eLKPj46ZGUvuBBRJs6HE5xkbGnDH5slvy++g9IaDFLEr3RDU+5isXcHx87WLQlKaZOn8S+xqmIs+ACScdiwkIxuc7o0vzG60f3oCvx93biFNax3A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=mhh8uLQo; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="mhh8uLQo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1744202364; bh=aC6H39PURz2QUDBngdSNG8br7W7dWUtEUshtsY93R/Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mhh8uLQoI3p3NNc4h7btWWNPb/fPy5xOET+3hALsZt+ufJ4VFnK9G/jPiONDxABjH dhWA3dafoDcKauF+CcDNtzT/SBKik+arVAnRq3kS1rOGn7bkWdrrC39MjxiRJ0/l50 p9wavx10I8fwQ9SpVKQtq8AxRo5Y4k1ve2FmCmntqe+mN2J6tEXEsz23B5IHBeNV4g hU6UO19UaYAxApKhvgEBfvbzdLYXBVDolm8+4Ld5uFSC2WzXJl0M5Hm8YHliW08bnb vKihmoVf+K5z6XRc1ZYWdqZMUAkSUeecLllqA2v42v9a9MqJB2MId+V6b4UzVnzNzV TTgvxp3dqvmHw== Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (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) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3E67717E0702; Wed, 9 Apr 2025 14:39:22 +0200 (CEST) Date: Wed, 9 Apr 2025 14:39:17 +0200 From: Boris Brezillon To: Philipp Stanner Cc: Sumit Semwal , Gustavo Padovan , Christian =?UTF-8?B?S8O2bmln?= , Felix Kuehling , Alex Deucher , Xinhui Pan , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas Stach , Russell King , Christian Gmeiner , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Frank Binns , Matt Coster , Qiang Yu , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , Lyude Paul , Danilo Krummrich , Rob Herring , Steven Price , Dave Airlie , Gerd Hoffmann , Matthew Brost , Huang Rui , Matthew Auld , Melissa Wen , =?UTF-8?B?TWHDrXJh?= Canal , Zack Rusin , Broadcom internal kernel review list , Lucas De Marchi , Thomas =?UTF-8?B?SGVsbHN0csO2bQ==?= , Bas Nieuwenhuizen , Yang Wang , Jesse Zhang , Tim Huang , Sathishkumar S , Saleemkhan Jamadar , Sunil Khatri , Lijo Lazar , Hawking Zhang , Ma Jun , Yunxiang Li , Eric Huang , Asad Kamal , Srinivasan Shanmugam , Jack Xiao , Friedrich Vock , Michel =?UTF-8?B?RMOkbnplcg==?= , Geert Uytterhoeven , Anna-Maria Behnsen , Thomas Gleixner , Frederic Weisbecker , Dan Carpenter , 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, etnaviv@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, lima@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, virtualization@lists.linux.dev, spice-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org Subject: Re: [PATCH 1/2] dma-fence: Rename dma_fence_is_signaled() Message-ID: <20250409143917.31303d22@collabora.com> In-Reply-To: <20250409120640.106408-3-phasta@kernel.org> References: <20250409120640.106408-2-phasta@kernel.org> <20250409120640.106408-3-phasta@kernel.org> Organization: Collabora X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Philipp, On Wed, 9 Apr 2025 14:06:37 +0200 Philipp Stanner wrote: > dma_fence_is_signaled()'s name strongly reads as if this function were > intended for checking whether a fence is already signaled. Also the > boolean it returns hints at that. > > The function's behavior, however, is more complex: it can check with a > driver callback whether the hardware's sequence number indicates that > the fence can already be treated as signaled, although the hardware's / > driver's interrupt handler has not signaled it yet. If that's the case, > the function also signals the fence. > > (Presumably) this has caused a bug in Nouveau (unknown commit), where > nouveau_fence_done() uses the function to check a fence, which causes a > race. > > Give the function a more obvious name. This is just my personal view on this, but I find the new name just as confusing as the old one. It sounds like something is checked, but it's clear what, and then the fence is forcibly signaled like it would be if you call drm_fence_signal(). Of course, this clarified by the doc, but given the goal was to make the function name clearly reflect what it does, I'm not convinced it's significantly better. Maybe dma_fence_check_hw_state_and_propagate(), though it might be too long of name. Oh well, feel free to ignore this comments if a majority is fine with the new name. Regards, Boris