linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panthor: fix for dma-fence safe access rules
@ 2025-12-04  1:50 Chia-I Wu
  2025-12-04  7:23 ` Boris Brezillon
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Chia-I Wu @ 2025-12-04  1:50 UTC (permalink / raw)
  To: Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Grant Likely, Heiko Stuebner, dri-devel, linux-kernel,
	tvrtko.ursulin

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 <olvaffe@gmail.com>
---
 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]);
 
-- 
2.52.0.177.g9f829587af-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-12-05 13:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-04  1:50 [PATCH] drm/panthor: fix for dma-fence safe access rules Chia-I Wu
2025-12-04  7:23 ` Boris Brezillon
2025-12-04  9:25 ` Liviu Dudau
2025-12-04  9:27 ` Tvrtko Ursulin
2025-12-04 17:42   ` Chia-I Wu
2025-12-05 12:46     ` Boris Brezillon
2025-12-05 12:50       ` Tvrtko Ursulin
2025-12-04 16:56 ` Steven Price

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).