From: Matthew Brost <matthew.brost@intel.com>
To: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
Michal Wajdeczko <michal.wajdeczko@intel.com>
Subject: Re: [PATCH v2 1/1] drm/xe/guc: Exclude indirect ring state page from ADS engine state size
Date: Mon, 4 May 2026 08:46:38 -0700 [thread overview]
Message-ID: <afi/XpbQb3aej8Tl@gsse-cloud1.jf.intel.com> (raw)
In-Reply-To: <20260504094924.3760713-4-satyanarayana.k.v.p@intel.com>
On Mon, May 04, 2026 at 09:49:26AM +0000, Satyanarayana K V P wrote:
> The engine state size reported to GuC via ADS should only include the
> engine state portion and should not include the indirect ring state page
> that comes after it in the context image. The GuC uses this size to
> overwrite the engine state in the LRC on watchdog resets and we don't
> want it to overwrite the indirect ring state as well.
>
I actually noticed this well over a year ago when looking at a indirect
ring state problem.
> Fixes: d6219e1cd5e3 ("drm/xe: Add Indirect Ring State support")
> Suggested-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
This looks right to me, so:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
But also since Daniele reviewed v1, ensure he doesn't have any other
comments before merging this.
Matt
> ---
> V1 -> V2:
> - Replaced xe_lrc_skip_size() with xe_lrc_engine_state_size().
> - Updated commit message (Daniel).
> ---
> drivers/gpu/drm/xe/xe_guc_ads.c | 5 +----
> drivers/gpu/drm/xe/xe_lrc.c | 11 +++++++++--
> drivers/gpu/drm/xe/xe_lrc.h | 2 +-
> 3 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c
> index ce651da6f318..b9bca6084a4f 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ads.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ads.c
> @@ -515,12 +515,9 @@ static void guc_golden_lrc_init(struct xe_guc_ads *ads)
> * that starts after the execlists LRC registers. This is
> * required to allow the GuC to restore just the engine state
> * when a watchdog reset occurs.
> - * We calculate the engine state size by removing the size of
> - * what comes before it in the context image (which is identical
> - * on all engines).
> */
> ads_blob_write(ads, ads.eng_state_size[guc_class],
> - real_size - xe_lrc_skip_size(xe));
> + xe_lrc_engine_state_size(gt, class));
> ads_blob_write(ads, ads.golden_context_lrca[guc_class],
> addr_ggtt);
>
> diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
> index 9db914584347..fdfe2ed5f683 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.c
> +++ b/drivers/gpu/drm/xe/xe_lrc.c
> @@ -727,9 +727,16 @@ size_t xe_lrc_reg_size(struct xe_device *xe)
> return 80 * sizeof(u32);
> }
>
> -size_t xe_lrc_skip_size(struct xe_device *xe)
> +/**
> + * xe_lrc_engine_state_size() - Get size of the engine state within LRC
> + * @gt: the &xe_gt struct instance
> + * @class: Hardware engine class
> + *
> + * Returns: Size of the engine state
> + */
> +size_t xe_lrc_engine_state_size(struct xe_gt *gt, enum xe_engine_class class)
> {
> - return LRC_PPHWSP_SIZE + xe_lrc_reg_size(xe);
> + return xe_gt_lrc_hang_replay_size(gt, class) - xe_lrc_reg_size(gt_to_xe(gt));
> }
>
> static inline u32 __xe_lrc_seqno_offset(struct xe_lrc *lrc)
> diff --git a/drivers/gpu/drm/xe/xe_lrc.h b/drivers/gpu/drm/xe/xe_lrc.h
> index e7c975f9e2d9..5440663183f6 100644
> --- a/drivers/gpu/drm/xe/xe_lrc.h
> +++ b/drivers/gpu/drm/xe/xe_lrc.h
> @@ -130,7 +130,7 @@ u32 xe_lrc_parallel_ggtt_addr(struct xe_lrc *lrc);
> struct iosys_map xe_lrc_parallel_map(struct xe_lrc *lrc);
>
> size_t xe_lrc_reg_size(struct xe_device *xe);
> -size_t xe_lrc_skip_size(struct xe_device *xe);
> +size_t xe_lrc_engine_state_size(struct xe_gt *gt, enum xe_engine_class class);
>
> void xe_lrc_dump_default(struct drm_printer *p,
> struct xe_gt *gt,
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-05-04 15:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 9:49 [PATCH v2 0/1] Do not include LRC indirect ring state size in engine state size Satyanarayana K V P
2026-05-04 9:49 ` [PATCH v2 1/1] drm/xe/guc: Exclude indirect ring state page from ADS " Satyanarayana K V P
2026-05-04 15:46 ` Matthew Brost [this message]
2026-05-04 23:59 ` Daniele Ceraolo Spurio
2026-05-04 10:04 ` ✓ CI.KUnit: success for Do not include LRC indirect ring state size in engine state size (rev2) Patchwork
2026-05-04 11:00 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-05-04 12:22 ` ✓ Xe.CI.FULL: success " Patchwork
2026-05-05 6:31 ` ✓ CI.KUnit: success for Do not include LRC indirect ring state size in engine state size (rev3) Patchwork
2026-05-05 8:03 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-05 12:51 ` ✓ Xe.CI.BAT: success for Do not include LRC indirect ring state size in engine state size (rev2) Patchwork
2026-05-05 15:31 ` ✗ Xe.CI.FULL: failure for Do not include LRC indirect ring state size in engine state size (rev3) Patchwork
2026-05-05 17:38 ` K V P, Satyanarayana
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=afi/XpbQb3aej8Tl@gsse-cloud1.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
--cc=satyanarayana.k.v.p@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