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 2EA2B29346F for ; Thu, 4 Dec 2025 07:24:03 +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=1764833045; cv=none; b=hbB+fSHNqs+TxBbGG4uwpDKKhq0JyjoF/wUuFVjBhZxknCbokPX9M3ZGhWIl4Ra4rn3dhbzkzz6mq/doSPSRnrMgzYq8GhqiLyUJT3+TBr9xiIQutPQ/xicInYlnh8xv8ANZenvF0s1TaIzb1oDuBT0/8ej/0L02Pb2Jdhn+PtY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764833045; c=relaxed/simple; bh=zCdhKTAewvebzcXbiVF6pwKKtDPYrzy4AB+FUn3+Or8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nuoAmI5kN5AV7aqOvEmB6ZWlsa/A2LnMHfm4SwZSEQCAC2HWi90Fuurza040jhG0p2bPlHaKL5J6zefBdRhVsKHfifBTzDXUzkV46cW6x/AhMQwrMbYHzNPiWh4VD3+OV71Di5HIRn2kx9qXHRUMfZh0nePgRvAp1pWViZuFwkQ= 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=pQ8KNRag; 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="pQ8KNRag" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1764833041; bh=zCdhKTAewvebzcXbiVF6pwKKtDPYrzy4AB+FUn3+Or8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pQ8KNRag7/ouAsm8kziPoD1BxpBVRsZuYtpiK+ZaYDhG6Qw2CPJDf8vHhiHue+44N NALVraeaiWP3fMqxTO7OHqgY/XfAoess0B4G6X77Z7VQnitoUm9TbjcgwiNMmdwo8t VgHc3cj/+MxwrjvhpgUH2WBnqG0HwWlchOKwkI+9geHsA3CuUv7ead/rDwI94dj6qS 5Bp8DPvUEka4wWyxVlQ3uKgv3yrYGLhg3yU0QU8VT/uHANrFp+BdyKd3mDzhceRfwq nQ6Zy8N9HPyy0Fzi3RvKypvDv0cFiR/5pLwPYxjJ8doJbFVUL+4i+KtM6I2SfkTUKS arCMDYF0b2tuQ== 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 95E6817E1155; Thu, 4 Dec 2025 08:24:00 +0100 (CET) Date: Thu, 4 Dec 2025 08:23:55 +0100 From: Boris Brezillon To: Chia-I Wu Cc: Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Grant Likely , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tvrtko.ursulin@igalia.com Subject: Re: [PATCH] drm/panthor: fix for dma-fence safe access rules Message-ID: <20251204082355.2fa133bb@fedora> In-Reply-To: <20251204015034.841235-1-olvaffe@gmail.com> References: <20251204015034.841235-1-olvaffe@gmail.com> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 3 Dec 2025 17:50:34 -0800 Chia-I Wu wrote: > Commit 506aa8b02a8d6 ("dma-fence: Add safe access helpers and document > the rules") details the dma-fence safe access rules. The most common > culprit is that drm_sched_fence_get_timeline_name may race with > group_free_queue. > > Fixes: d2624d90a0b77 ("drm/panthor: assign unique names to queues") > Signed-off-by: Chia-I Wu Reviewed-by: Boris Brezillon > --- > drivers/gpu/drm/panthor/panthor_sched.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index 33b9ef537e359..a8b1347e4da71 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > #include "panthor_devfreq.h" > #include "panthor_device.h" > @@ -923,6 +924,9 @@ static void group_release_work(struct work_struct *work) > release_work); > u32 i; > > + /* dma-fences may still be accessing group->queues under rcu lock. */ > + synchronize_rcu(); > + > for (i = 0; i < group->queue_count; i++) > group_free_queue(group, group->queues[i]); >