All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Subject: Re: [PATCH 3/3] drm/xe: Memset g2g buffer on resume
Date: Fri, 16 Oct 2026 11:49:23 -0700	[thread overview]
Message-ID: <atJxs5BOjChYDEaX@gsse-cloud1.jf.intel.com> (raw)
In-Reply-To: <20261015165451.154495-8-vinay.belgaumkar@intel.com>

On Thu, Oct 15, 2026 at 09:54:55AM -0700, Vinay Belgaumkar wrote:
> KMD creates this buffer for use by GuC, it is also responsible for zeroing
> it during resume. The buffer is marked as XE_BO_FLAG_PINNED_NORESTORE,
> so we cannot trust its contents after a suspend cycle. This commit adds
> xe_gt_resume_early() function for handling this and the C6 disable
> during resume.
> 

Fixes?

Also I have question here: Does this mean after d3cold memory does not
init to zero? This was an open question I had which merging
clear-of-free as I didn't know upon d3cold exit if buddy blocks in
cleared list would still be cleared? Any insight here would be helpful
as I think Tejas is picking up the clear-on-free work and this would be
good input to give him.

Matt 

> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt.c | 18 ++++++++++++++++++
>  drivers/gpu/drm/xe/xe_gt.h |  1 +
>  drivers/gpu/drm/xe/xe_pm.c |  4 ++--
>  3 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 775c826b68b4..02f5d48b1a65 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -1069,6 +1069,24 @@ int xe_gt_sanitize_freq(struct xe_gt *gt)
>  	return ret;
>  }
>  
> +/**
> + * xe_gt_resume_early() - Early init for GT resume
> + * @gt: the GT object
> + *
> + * Handles GT related init before GT restart after a suspend cycle.
> + */
> +void xe_gt_resume_early(struct xe_gt *gt)
> +{
> +	struct xe_device *xe = gt_to_xe(gt);
> +	struct xe_guc *guc = &gt->uc.guc;
> +
> +	xe_gt_idle_disable_c6(gt);
> +
> +	/* clear the g2g buffer which is marked as NORESTORE during alloc */
> +	if (guc->g2g.bo && guc->g2g.owned)
> +		xe_map_memset(xe, &guc->g2g.bo->vmap, 0, 0, xe_bo_size(guc->g2g.bo));
> +}
> +
>  int xe_gt_resume(struct xe_gt *gt)
>  {
>  	int err;
> diff --git a/drivers/gpu/drm/xe/xe_gt.h b/drivers/gpu/drm/xe/xe_gt.h
> index 92d934d50244..9b69f36ebc7a 100644
> --- a/drivers/gpu/drm/xe/xe_gt.h
> +++ b/drivers/gpu/drm/xe/xe_gt.h
> @@ -58,6 +58,7 @@ void xe_gt_record_user_engines(struct xe_gt *gt);
>  void xe_gt_suspend_prepare(struct xe_gt *gt);
>  int xe_gt_suspend(struct xe_gt *gt);
>  void xe_gt_shutdown(struct xe_gt *gt);
> +void xe_gt_resume_early(struct xe_gt *gt);
>  int xe_gt_resume(struct xe_gt *gt);
>  void xe_gt_reset_async(struct xe_gt *gt);
>  int xe_gt_runtime_resume(struct xe_gt *gt);
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index 1f5097875bcd..89d64aa6577d 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -249,7 +249,7 @@ int xe_pm_resume(struct xe_device *xe)
>  		return err;
>  
>  	for_each_gt(gt, xe, id)
> -		xe_gt_idle_disable_c6(gt);
> +		xe_gt_resume_early(gt);
>  
>  	xe_display_pm_resume_early(xe);
>  
> @@ -703,7 +703,7 @@ int xe_pm_runtime_resume(struct xe_device *xe)
>  			goto out;
>  
>  		for_each_gt(gt, xe, id)
> -			xe_gt_idle_disable_c6(gt);
> +			xe_gt_resume_early(gt);
>  
>  		xe_display_pm_resume_early(xe);
>  
> -- 
> 2.53.0
> 

  reply	other threads:[~2026-10-16 18:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 16:54 [PATCH 0/3] drm/xe: Some d3cold related fixes Vinay Belgaumkar
2026-10-15 16:54 ` [PATCH 1/3] drm/xe: Toggle the D3Cold enable flag at runtime resume Vinay Belgaumkar
2026-10-16 18:23   ` [1/3] " Poosa, Karthik
2026-10-16 18:35     ` Belgaumkar, Vinay
2026-10-15 16:54 ` [PATCH 2/3] drm/xe: Access MMIO after pcode init Vinay Belgaumkar
2026-10-15 23:43   ` sashiko-bot
2026-10-15 23:52     ` Belgaumkar, Vinay
2026-10-16 18:02   ` [2/3] " Poosa, Karthik
2026-10-16 18:05     ` Belgaumkar, Vinay
2026-10-15 16:54 ` [PATCH 3/3] drm/xe: Memset g2g buffer on resume Vinay Belgaumkar
2026-10-16 18:49   ` Matthew Brost [this message]
2026-10-16 18:56     ` Matthew Brost
2026-10-16 20:43     ` Belgaumkar, Vinay
2026-10-16  0:03 ` ✓ CI.KUnit: success for drm/xe: Some d3cold related fixes Patchwork
2026-10-16  0:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-16 11:38 ` ✓ Xe.CI.FULL: " 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=atJxs5BOjChYDEaX@gsse-cloud1.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=vinay.belgaumkar@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.