Skip to content

Commit 35d25a4

Browse files
mbrost05lucasdemarchi
authored andcommitted
drm/xe: Don't short circuit TDR on jobs not started
Short circuiting TDR on jobs not started is an optimization which is not required. On LNL we are facing an issue where jobs do not get scheduled by the GuC if it misses a GGTT page update. When this occurs let the TDR fire, toggle the scheduling which may get the job unstuck, and print a warning message. If the TDR fires twice on job that hasn't started, timeout the job. v2: - Add warning message (Paulo) - Add fixes tag (Paulo) - Timeout job which hasn't started after TDR firing twice v3: - Include local change v4: - Short circuit check_timeout on job not started - use warn level rather than notice (Paulo) Fixes: 7ddb940 ("drm/xe: Sample ctx timestamp to determine if jobs have timed out") Cc: stable@vger.kernel.org Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241025214330.2010521-2-matthew.brost@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 5a71019 commit 35d25a4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -991,12 +991,22 @@ static void xe_guc_exec_queue_lr_cleanup(struct work_struct *w)
991991
static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job)
992992
{
993993
struct xe_gt *gt = guc_to_gt(exec_queue_to_guc(q));
994-
u32 ctx_timestamp = xe_lrc_ctx_timestamp(q->lrc[0]);
995-
u32 ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]);
994+
u32 ctx_timestamp, ctx_job_timestamp;
996995
u32 timeout_ms = q->sched_props.job_timeout_ms;
997996
u32 diff;
998997
u64 running_time_ms;
999998

999+
if (!xe_sched_job_started(job)) {
1000+
xe_gt_warn(gt, "Check job timeout: seqno=%u, lrc_seqno=%u, guc_id=%d, not started",
1001+
xe_sched_job_seqno(job), xe_sched_job_lrc_seqno(job),
1002+
q->guc->id);
1003+
1004+
return xe_sched_invalidate_job(job, 2);
1005+
}
1006+
1007+
ctx_timestamp = xe_lrc_ctx_timestamp(q->lrc[0]);
1008+
ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]);
1009+
10001010
/*
10011011
* Counter wraps at ~223s at the usual 19.2MHz, be paranoid catch
10021012
* possible overflows with a high timeout.
@@ -1126,10 +1136,6 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
11261136
exec_queue_killed_or_banned_or_wedged(q) ||
11271137
exec_queue_destroyed(q);
11281138

1129-
/* Job hasn't started, can't be timed out */
1130-
if (!skip_timeout_check && !xe_sched_job_started(job))
1131-
goto rearm;
1132-
11331139
/*
11341140
* If devcoredump not captured and GuC capture for the job is not ready
11351141
* do manual capture first and decide later if we need to use it

0 commit comments

Comments
 (0)