On Wed, Jun 03, 2026 at 05:36:41PM +0530, Sanjay Yadav wrote:
> drm_sched_tdr_queue_imm() sets sched->timeout to 0 and never restores
> it. This breaks all future TDR timers — jobs get timed out instantly
> before they even start running on hardware.
> 
> Use mod_delayed_work() directly to fire the TDR worker immediately
> without modifying the timeout field. This preserves the original
> timeout value for subsequent job submissions.
> 
> Fixes: 8ec5a4e5ce97 ("drm/xe: Resume TDR after GT reset")
> Cc: <[email protected]> # v6.13+
> Cc: Matthew Brost <[email protected]>
> Cc: Thomas Hellström <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Assisted-by: Claude:claude-opus-4.6
> Suggested-by: Himal Prasad Ghimiray <[email protected]>
> Signed-off-by: Sanjay Yadav <[email protected]>
> ---
>  drivers/gpu/drm/scheduler/sched_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c 
> b/drivers/gpu/drm/scheduler/sched_main.c
> index 818d3d4434b5..be144e244745 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -212,8 +212,8 @@ static void drm_sched_start_timeout_unlocked(struct 
> drm_gpu_scheduler *sched)
>  void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched)
>  {
>       spin_lock(&sched->job_list_lock);
> -     sched->timeout = 0;
> -     drm_sched_start_timeout(sched);
> +     if (!list_empty(&sched->pending_list))
> +             mod_delayed_work(sched->timeout_wq, &sched->work_tdr, 0);

No, please. If there's something wrong with the timeout clear we need
to get that fixed at the drm layer instead of doing our own.

>       spin_unlock(&sched->job_list_lock);
>  }
>  EXPORT_SYMBOL(drm_sched_tdr_queue_imm);
> -- 
> 2.52.0
> 

Reply via email to