Re: [PATCH] drm/sched: drop the unused entity argument from drm_sched_fence_alloc()
From: Philipp Stanner
Date: Wed Sep 09 2026 - 03:56:05 EST
On Wed, 2026-09-09 at 09:51 +0900, Donggeun Yoo wrote:
> drm_sched_fence_alloc() takes a struct drm_sched_entity *entity but
> never uses it. Its only use, fence->sched = entity->rq->sched, moved
> into drm_sched_fence_init() by commit dbe48d030b28 ("drm/sched: Split
> drm_sched_job_init"), which separated fence allocation in
> drm_sched_job_init() from arming in drm_sched_job_arm(). The deref
> belongs at arm: drm_sched_job_arm() selects the run-queue via
> drm_sched_entity_select_rq(), so for an entity with more than one
> scheduler, entity->rq need not yet point at the scheduler the job lands
> on. Reading it at allocation time could bind the fence to the wrong
> scheduler.
I think that paragraph is a bit overkill ;)
Especially the last sentence reads a bit like you're addressing a bug,
but it's just about removing an unused parameter.
I think saying "In commit dbe48d030b28 ("… … it was forgotten to remove
a now unused function argument" is enough. Who's interested in details
can then look at the commit.
>
> Drop the argument. The sole caller still passes the entity to
> drm_sched_fence_init() at arm time, so behavior is unchanged. This also
> removes the parameter-name mismatch between the declaration (s_entity)
> and the definition (entity).
This paragraph is good.
P.