Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/sched: revert "drm_sched_job_cleanup(): correct false doc"

This reverts commit 44d2f310f008613c1dbe5e234c2cf2be90cbbfab.

The function drm_sched_job_arm() is indeed the point of no return. The
background is that it is nearly impossible for the driver to correctly
retract the fence and signal it in the order enforced by the dma_fence
framework.

The code in drm_sched_job_cleanup() is for the purpose to cleanup after
the job was armed through drm_sched_job_arm() *and* processed by the
scheduler.

We can certainly improve the documentation, but removing the warning is
clearly not a good idea.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250312134400.2176393-1-christian.koenig@amd.com

authored by

Christian König and committed by
Philipp Stanner
c67c0fef eff0347e

+5 -7
+5 -7
drivers/gpu/drm/scheduler/sched_main.c
··· 1015 1015 * Cleans up the resources allocated with drm_sched_job_init(). 1016 1016 * 1017 1017 * Drivers should call this from their error unwind code if @job is aborted 1018 - * before it was submitted to an entity with drm_sched_entity_push_job(). 1018 + * before drm_sched_job_arm() is called. 1019 1019 * 1020 - * Since calling drm_sched_job_arm() causes the job's fences to be initialized, 1021 - * it is up to the driver to ensure that fences that were exposed to external 1022 - * parties get signaled. drm_sched_job_cleanup() does not ensure this. 1023 - * 1024 - * This function must also be called in &struct drm_sched_backend_ops.free_job 1020 + * After that point of no return @job is committed to be executed by the 1021 + * scheduler, and this function should be called from the 1022 + * &drm_sched_backend_ops.free_job callback. 1025 1023 */ 1026 1024 void drm_sched_job_cleanup(struct drm_sched_job *job) 1027 1025 { ··· 1030 1032 /* drm_sched_job_arm() has been called */ 1031 1033 dma_fence_put(&job->s_fence->finished); 1032 1034 } else { 1033 - /* aborted job before arming */ 1035 + /* aborted job before committing to run it */ 1034 1036 drm_sched_fence_free(job->s_fence); 1035 1037 } 1036 1038