From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
Matthew Brost <matthew.brost@intel.com>,
Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: [PATCH] drm/xe/guc_submit: Simplify and fix diff calculation
Date: Tue, 13 May 2025 07:25:49 -0700 [thread overview]
Message-ID: <20250513-time-wrap-v1-1-fba9a69a65c8@intel.com> (raw)
With a u32 type, there's no need to check which one is greater: the
current is always the latest and if it's less than the previous, it's
because it wrapped: just do the unsigned calculation that will lead to
the same result, or better the correct one. It fixes an off-by-one in
the wrapped calculation, however that doesn't really matter for the
timeout calculation.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
drivers/gpu/drm/xe/xe_guc_submit.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index fb125f940de8f..80f748baad3f3 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -976,10 +976,7 @@ static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job)
*/
xe_gt_assert(gt, timeout_ms < 100 * MSEC_PER_SEC);
- if (ctx_timestamp < ctx_job_timestamp)
- diff = ctx_timestamp + U32_MAX - ctx_job_timestamp;
- else
- diff = ctx_timestamp - ctx_job_timestamp;
+ diff = ctx_timestamp - ctx_job_timestamp;
/*
* Ensure timeout is within 5% to account for an GuC scheduling latency
next reply other threads:[~2025-05-13 14:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 14:25 Lucas De Marchi [this message]
2025-05-13 14:59 ` [PATCH] drm/xe/guc_submit: Simplify and fix diff calculation Raag Jadav
2025-05-14 14:32 ` ✓ CI.Patch_applied: success for " Patchwork
2025-05-14 14:32 ` ✓ CI.checkpatch: " Patchwork
2025-05-14 14:33 ` ✓ CI.KUnit: " Patchwork
2025-05-14 14:52 ` ✓ CI.Hooks: " Patchwork
2025-05-14 14:55 ` ✓ CI.Build: " Patchwork
2025-05-14 14:56 ` ✓ CI.checksparse: " Patchwork
2025-05-14 15:26 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-14 20:35 ` ✓ Xe.CI.Full: " Patchwork
2025-05-14 22:29 ` [PATCH] " Umesh Nerlige Ramappa
2025-05-14 23:54 ` Matthew Brost
2025-05-27 0:29 ` ✗ CI.Patch_applied: failure for " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250513-time-wrap-v1-1-fba9a69a65c8@intel.com \
--to=lucas.demarchi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=umesh.nerlige.ramappa@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox