[PATCH v4 13/18] drm/sched: Check locking in drm_sched_job_await_implicit

Daniel Vetter daniel.vetter at ffwll.ch
Mon Jul 12 17:53:47 UTC 2021


You really need to hold the reservation here or all kinds of funny
things can happen between grabbing the dependencies and inserting the
new fences.

Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
Cc: "Christian König" <christian.koenig at amd.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Luben Tuikov <luben.tuikov at amd.com>
Cc: Andrey Grodzovsky <andrey.grodzovsky at amd.com>
Cc: Alex Deucher <alexander.deucher at amd.com>
Cc: Jack Zhang <Jack.Zhang1 at amd.com>
---
 drivers/gpu/drm/scheduler/sched_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index fd52db906b90..6fa6ccd30d2a 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -714,6 +714,8 @@ int drm_sched_job_await_implicit(struct drm_sched_job *job,
 	struct dma_fence **fences;
 	unsigned int i, fence_count;
 
+	dma_resv_assert_held(obj->resv);
+
 	if (!write) {
 		struct dma_fence *fence = dma_resv_get_excl_unlocked(obj->resv);
 
-- 
2.32.0



More information about the dri-devel mailing list