All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/lrc: Fix uninitialized new_ts when capturing context timestamp
Date: Thu, 12 Mar 2026 15:04:51 -0700	[thread overview]
Message-ID: <87pl58r9fg.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20260312125308.3126607-2-umesh.nerlige.ramappa@intel.com>

On Thu, 12 Mar 2026 05:53:09 -0700, Umesh Nerlige Ramappa wrote:
>
> Getting engine specific CTX TIMESTAMP register can fail. In that case,
> if the context is active, new_ts is uninitialized. Fix that case by
> initializing new_ts to the last value that was sampled in SW -
> lrc->ctx_timestamp.
>
> Flagged by static analysis.
>
> v2: Fix new_ts initialization (Ashutosh)

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_lrc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
> index aa26c71ae34f..04304dff45b0 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.c
> +++ b/drivers/gpu/drm/xe/xe_lrc.c
> @@ -2563,14 +2563,14 @@ static int get_ctx_timestamp(struct xe_lrc *lrc, u32 engine_id, u64 *reg_ctx_ts)
>   * @lrc: Pointer to the lrc.
>   *
>   * Return latest ctx timestamp. With support for active contexts, the
> - * calculation may bb slightly racy, so follow a read-again logic to ensure that
> + * calculation may be slightly racy, so follow a read-again logic to ensure that
>   * the context is still active before returning the right timestamp.
>   *
>   * Returns: New ctx timestamp value
>   */
>  u64 xe_lrc_timestamp(struct xe_lrc *lrc)
>  {
> -	u64 lrc_ts, reg_ts, new_ts;
> +	u64 lrc_ts, reg_ts, new_ts = lrc->ctx_timestamp;
>	u32 engine_id;
>
>	lrc_ts = xe_lrc_ctx_timestamp(lrc);
> --
> 2.51.0
>

  parent reply	other threads:[~2026-03-12 22:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12 12:53 [PATCH] drm/xe/lrc: Fix uninitialized new_ts when capturing context timestamp Umesh Nerlige Ramappa
2026-03-12 13:00 ` ✓ CI.KUnit: success for drm/xe/lrc: Fix uninitialized new_ts when capturing context timestamp (rev2) Patchwork
2026-03-12 14:01 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-12 22:04 ` Dixit, Ashutosh [this message]
2026-03-13 12:11 ` ✓ Xe.CI.FULL: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-03-11 10:49 [PATCH] drm/xe/lrc: Fix uninitialized new_ts when capturing context timestamp Umesh Nerlige Ramappa
2026-03-11 23:43 ` Dixit, Ashutosh
2026-03-12 12:35   ` Umesh Nerlige Ramappa

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=87pl58r9fg.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.