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 67427E7DEFF for ; Mon, 2 Feb 2026 16:51:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A464310E512; Mon, 2 Feb 2026 16:51:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="icfWXZGa"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id D27E210E50A for ; Mon, 2 Feb 2026 16:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1770051098; bh=BVobBSolLg2u4uVFhlIDF59kr5adWOoTYdZJlPWctQw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=icfWXZGayh5/x4+X62JQ/OyZC4cXV4Wa1oftWh88dUL3hXEMgBsIoDHWeHUfL2DNH 1FneaDJfmAXdSCYxbvgdtuy9GRjwqoakAOVCt+6ksBmUxBnYoFz7HSlbBDFY/YNdzl cUW5w64nluq6Va9z4ZyvrzejB6WGL7vbPo/eJFDg8KrVbf8py00CQx4/EBQBWCmvjb ux6cDjJbGBR6N4wp1m7PGaxHpdKWr08cmyB9NAbODuxCj+1cIX4n1QoTFYUNvyG5At 5MGLv8zHtmguXqgACIYtwmd+a8Pgp4DK2qCr94oDoxpBiJN2PdI2Ba5C96DvMtJlUg VDkHZE0WLUFSg== 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 9863C17E1203; Mon, 2 Feb 2026 17:51:37 +0100 (CET) Date: Mon, 2 Feb 2026 17:51:34 +0100 From: Boris Brezillon To: Steven Price Cc: Liviu Dudau , =?UTF-8?B?QWRyacOhbg==?= Larumbe , dri-devel@lists.freedesktop.org, David Airlie , Simona Vetter , Akash Goel , Rob Clark , Sean Paul , Konrad Dybcio , Akhil P Oommen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Dmitry Osipenko , Chris Diamand , Danilo Krummrich , Matthew Brost , Thomas =?UTF-8?B?SGVsbHN0csO2bQ==?= , Alice Ryhl , kernel@collabora.com Subject: Re: [PATCH v2 4/8] drm/panthor: Part ways with drm_gem_shmem_object Message-ID: <20260202175134.4d0b59ad@fedora> In-Reply-To: <2823b376-1917-4718-b78e-99df77ba4bd5@arm.com> References: <20260202113607.1745667-1-boris.brezillon@collabora.com> <20260202113607.1745667-5-boris.brezillon@collabora.com> <2823b376-1917-4718-b78e-99df77ba4bd5@arm.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=US-ASCII Content-Transfer-Encoding: 7bit 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, 2 Feb 2026 16:35:26 +0000 Steven Price wrote: > > + > > +void panthor_gem_unpin(struct panthor_gem_object *bo) > > +{ > > + if (drm_gem_is_imported(&bo->base)) > > + return; > > + > > + if (!refcount_dec_not_one(&bo->backing.pin_count)) > > + panthor_gem_backing_unpin_locked(bo); > > I don't think we're holding the resv lock here? In which case we need a > dma_resv_lock()/unlock() pair around this. Absolutely. I'll fix that in the next version. > > +struct drm_gem_object * > > +panthor_gem_prime_import_sg_table(struct drm_device *dev, > > + struct dma_buf_attachment *attach, > > + struct sg_table *sgt) > > +{ > > + struct panthor_gem_object *bo; > > + int ret; > > + > > + bo = panthor_gem_alloc_object(0); > > + if (IS_ERR(bo)) > > + return &bo->base; > > Should be ERR_CAST(bo) - bo isn't a valid pointer here. Good catch. Will fix in v3.