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

drm/sched: Fix comment in drm_sched_run_job_work()

drm_sched_run_job_work() contains a comment which explains that an
entity being NULL means that there is no more work to do. It can,
however, also mean that there is work, but the scheduler doesn't have
enough credits to process the jobs right now.

Provide this detail in the comment.

Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20251028134602.94125-3-phasta@kernel.org

+7 -2
+7 -2
drivers/gpu/drm/scheduler/sched_main.c
··· 1237 1237 1238 1238 /* Find entity with a ready job */ 1239 1239 entity = drm_sched_select_entity(sched); 1240 - if (!entity) 1241 - return; /* No more work */ 1240 + if (!entity) { 1241 + /* 1242 + * Either no more work to do, or the next ready job needs more 1243 + * credits than the scheduler has currently available. 1244 + */ 1245 + return; 1246 + } 1242 1247 1243 1248 sched_job = drm_sched_entity_pop_job(entity); 1244 1249 if (!sched_job) {