Skip to content

Commit 2e07570

Browse files
author
Philipp Stanner
committed
drm/sched: Document purpose of drm_sched_{start,stop}
drm_sched_start()'s and drm_sched_stop()'s names suggest that those functions might be intended for actively starting and stopping the scheduler on initialization and teardown. They are, however, only used on timeout handling (reset recovery). The docstrings should reflect that to prevent confusion. Document those functions' purpose. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Philipp Stanner <pstanner@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241029133819.78696-2-pstanner@redhat.com
1 parent 766515a commit 2e07570

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/gpu/drm/scheduler/sched_main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ static void drm_sched_job_timedout(struct work_struct *work)
593593
* callers responsibility to release it manually if it's not part of the
594594
* pending list any more.
595595
*
596+
* This function is typically used for reset recovery (see the docu of
597+
* drm_sched_backend_ops.timedout_job() for details). Do not call it for
598+
* scheduler teardown, i.e., before calling drm_sched_fini().
596599
*/
597600
void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad)
598601
{
@@ -665,7 +668,6 @@ void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad)
665668
*/
666669
cancel_delayed_work(&sched->work_tdr);
667670
}
668-
669671
EXPORT_SYMBOL(drm_sched_stop);
670672

671673
/**
@@ -674,6 +676,10 @@ EXPORT_SYMBOL(drm_sched_stop);
674676
* @sched: scheduler instance
675677
* @errno: error to set on the pending fences
676678
*
679+
* This function is typically used for reset recovery (see the docu of
680+
* drm_sched_backend_ops.timedout_job() for details). Do not call it for
681+
* scheduler startup. The scheduler itself is fully operational after
682+
* drm_sched_init() succeeded.
677683
*/
678684
void drm_sched_start(struct drm_gpu_scheduler *sched, int errno)
679685
{

0 commit comments

Comments
 (0)