]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panthor: fix for dma-fence safe access rules
authorChia-I Wu <olvaffe@gmail.com>
Thu, 4 Dec 2025 17:45:45 +0000 (09:45 -0800)
committerSteven Price <steven.price@arm.com>
Wed, 17 Dec 2025 15:50:54 +0000 (15:50 +0000)
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@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Cc: stable@vger.kernel.org # v6.17+
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20251204174545.399059-1-olvaffe@gmail.com
drivers/gpu/drm/panthor/panthor_sched.c

index a17b067a04392b7f877c255c7bd7c95f312f8188..0f83e778d89aa754f45600ab624c9730e14c9694 100644 (file)
@@ -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]);