[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251205134307.6a06f9e1@fedora>
Date: Fri, 5 Dec 2025 13:43:07 +0100
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Chia-I Wu <olvaffe@...il.com>
Cc: Steven Price <steven.price@....com>, Liviu Dudau <liviu.dudau@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
<mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David Airlie
<airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Grant Likely
<grant.likely@...aro.org>, Heiko Stuebner <heiko@...ech.de>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
tvrtko.ursulin@...lia.com
Subject: Re: [PATCH v2] drm/panthor: fix for dma-fence safe access rules
On Thu, 4 Dec 2025 09:45:45 -0800
Chia-I Wu <olvaffe@...il.com> 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.
>
> Signed-off-by: Chia-I Wu <olvaffe@...il.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@...labora.com>
> Reviewed-by: Liviu Dudau <liviu.dudau@....com>
> Reviewed-by: Steven Price <steven.price@....com>
>
> ---
> v2: collect R-bs and drop misleading Fixes: tag
Should we at least
Cc: stable@...r.kernel.org
so this gets considered for backporting?
> ---
> 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 <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/pm_runtime.h>
> +#include <linux/rcupdate.h>
>
> #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]);
>
Powered by blists - more mailing lists