Commit efe24898 authored by Chia-I Wu's avatar Chia-I Wu Committed by Steven Price
Browse files

drm/panthor: fix for dma-fence safe access rules



Commit 506aa8b0 ("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: default avatarChia-I Wu <olvaffe@gmail.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Cc: stable@vger.kernel.org # v6.17+
Signed-off-by: default avatarSteven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20251204174545.399059-1-olvaffe@gmail.com
parent 97f41984
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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"
@@ -943,6 +944,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]);