[PATCH] drm/sched: Consolidate drm_sched_job_timedout

Danilo Krummrich dakr at kernel.org
Thu Jul 17 10:19:51 UTC 2025


On Wed Jul 16, 2025 at 4:48 PM CEST, Tvrtko Ursulin wrote:
> Reduce to one spin_unlock for hopefully a little bit clearer flow in the
> function. It may appear that there is a behavioural change with the
> drm_sched_start_timeout_unlocked() now not being called if there were
> initially no jobs on the pending list, and then some appeared after
> unlock, however if the code would rely on the TDR handler restarting
> itself then it would fail to do that if the job arrived on the pending
> list after the check.

To me this patch comes down to "don't call drm_sched_start_timeout_unlocked()
when the pending list is empty".

That's the whole premise for the early return the patch is based on.

The commit subject / message makes this more of a side note and when I read it,
it wasn't obvious to me why that's correct.

Can you please emphasise this a bit more, since that's really the actual change,
and make it more clear why drm_sched_start_timeout_unlocked() only needs to be
called when we actually find a job on the pending list.

The reason you mention in the commit message "if the code would rely on the TDR
handler restarting itself then it would fail to do that if the job arrived on
the pending list after the check" reads more like "the approch can't work
anyways, hence remove it". That's not a justification why removing it is correct
though.


More information about the Intel-xe mailing list