[PATCH 6.19 512/844] drm/panthor: fix for dma-fence safe access rules
From: Sasha Levin
Date: Sat Feb 28 2026 - 15:28:09 EST
From: Chia-I Wu <olvaffe@xxxxxxxxx>
[ Upstream commit efe24898485c5c831e629d9c6fb9350c35cb576f ]
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@xxxxxxxxx>
Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
Reviewed-by: Liviu Dudau <liviu.dudau@xxxxxxx>
Reviewed-by: Steven Price <steven.price@xxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx # v6.17+
Signed-off-by: Steven Price <steven.price@xxxxxxx>
Link: https://patch.msgid.link/20251204174545.399059-1-olvaffe@xxxxxxxxx
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
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 bd397d773d72b..5c55ba593b244 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"
@@ -939,6 +940,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]);
--
2.51.0