Skip to content
/ linux Public

Commit ab8c0de

Browse files
olvaffeSasha Levin
authored andcommitted
drm/panthor: fix for dma-fence safe access rules
[ Upstream commit efe2489 ] Commit 506aa8b ("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a803cfa commit ab8c0de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/panthor/panthor_sched.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/module.h>
2323
#include <linux/platform_device.h>
2424
#include <linux/pm_runtime.h>
25+
#include <linux/rcupdate.h>
2526

2627
#include "panthor_devfreq.h"
2728
#include "panthor_device.h"
@@ -926,6 +927,9 @@ static void group_release_work(struct work_struct *work)
926927
release_work);
927928
u32 i;
928929

930+
/* dma-fences may still be accessing group->queues under rcu lock. */
931+
synchronize_rcu();
932+
929933
for (i = 0; i < group->queue_count; i++)
930934
group_free_queue(group, group->queues[i]);
931935

0 commit comments

Comments
 (0)