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 3C948EF3718 for ; Mon, 9 Mar 2026 17:33:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A28D710E18F; Mon, 9 Mar 2026 17:33:01 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 333E810E18F for ; Mon, 9 Mar 2026 17:33:00 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 734CF1477 for ; Mon, 9 Mar 2026 10:32:53 -0700 (PDT) Received: from [192.168.0.1] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6A8253F694 for ; Mon, 9 Mar 2026 10:32:59 -0700 (PDT) Date: Mon, 9 Mar 2026 17:30:57 +0000 From: Liviu Dudau To: Boris Brezillon Cc: Steven Price , =?utf-8?Q?Adri=C3=A1n?= Larumbe , dri-devel@lists.freedesktop.org, kernel@collabora.com, Nicolas Frattaroli , Tvrtko Ursulin , Philipp Stanner , Christian =?utf-8?B?S8O2bmln?= Subject: Re: [PATCH v2] drm/panthor: Fix the "done_fence is initialized" detection logic Message-ID: References: <20260309124318.222902-1-boris.brezillon@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260309124318.222902-1-boris.brezillon@collabora.com> 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 Mon, Mar 09, 2026 at 01:43:18PM +0100, Boris Brezillon wrote: > After commit 541c8f2468b9 ("dma-buf: detach fence ops on signal v3"), > dma_fence::ops == NULL can't be used to check if the fence is initialized. > Use dma_fence_was_initialized() instead. > > v2: > - Use dma_fence_was_initialized() instead of open-coding it > > Cc: Nicolas Frattaroli > Cc: Tvrtko Ursulin > Cc: Philipp Stanner > Cc: Christian König > Reported-by: Steven Price > Reported-by: Nicolas Frattaroli > Fixes: 541c8f2468b9 ("dma-buf: detach fence ops on signal v3") > Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index bd703a2904a1..c15941ebe07a 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -3915,7 +3915,7 @@ static void job_release(struct kref *ref) > if (job->base.s_fence) > drm_sched_job_cleanup(&job->base); > > - if (job->done_fence && job->done_fence->ops) > + if (dma_fence_was_initialized(job->done_fence)) > dma_fence_put(job->done_fence); > else > dma_fence_free(job->done_fence); > -- > 2.53.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯