Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Raag Jadav <raag.jadav@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <rodrigo.vivi@intel.com>,
	<thomas.hellstrom@linux.intel.com>, <riana.tauro@intel.com>,
	<michal.wajdeczko@intel.com>, <matthew.d.roper@intel.com>,
	<michal.winiarski@intel.com>
Subject: Re: [PATCH v1 5/6] drm/xe/bo_evict: Introduce xe_bo_restore_map()
Date: Tue, 24 Feb 2026 14:11:38 -0800	[thread overview]
Message-ID: <aZ4iGmnnvHK2fZ9M@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20260224102618.3105171-6-raag.jadav@intel.com>

On Tue, Feb 24, 2026 at 03:55:18PM +0530, Raag Jadav wrote:
> In preparation of usecases which require remapping kernel bos after FLR,
> introduce xe_bo_restore_map() helper.
> 



> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_bo_evict.c | 34 ++++++++++++++++++++++++--------
>  drivers/gpu/drm/xe/xe_bo_evict.h |  2 ++
>  2 files changed, 28 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c
> index 7661fca7f278..0624c3039cd7 100644
> --- a/drivers/gpu/drm/xe/xe_bo_evict.c
> +++ b/drivers/gpu/drm/xe/xe_bo_evict.c
> @@ -189,14 +189,8 @@ int xe_bo_evict_all(struct xe_device *xe)
>  				     xe_bo_evict_pinned);
>  }
>  
> -static int xe_bo_restore_and_map_ggtt(struct xe_bo *bo)
> +static int xe_bo_map_ggtt(struct xe_bo *bo)
>  {
> -	int ret;
> -
> -	ret = xe_bo_restore_pinned(bo);
> -	if (ret)
> -		return ret;
> -
>  	if (bo->flags & XE_BO_FLAG_GGTT) {
>  		struct xe_tile *tile;
>  		u8 id;
> @@ -212,6 +206,30 @@ static int xe_bo_restore_and_map_ggtt(struct xe_bo *bo)
>  	return 0;
>  }
>  
> +int xe_bo_restore_map(struct xe_device *xe)

Kernel doc. Maybe also explain why this function is needed during PCIe
FLR in both the commit message and the kernel doc. I assume it’s
something along the lines of: “During PCIe FLR we repopulate the GGTTs
for any kernel BOs required for driver restart that lost GGTTs across FLR."

Just guessing on above but if we had kernel doc I wouldn't have to.

> +{
> +	int ret;
> +
> +	ret = xe_bo_apply_to_pinned(xe, &xe->pinned.early.kernel_bo_present,
> +				    &xe->pinned.early.kernel_bo_present, xe_bo_map_ggtt);
> +	if (!ret)
> +		ret = xe_bo_apply_to_pinned(xe, &xe->pinned.late.kernel_bo_present,
> +					    &xe->pinned.late.kernel_bo_present, xe_bo_map_ggtt);
> +
> +	return ret;
> +}
> +
> +static int xe_bo_restore_and_map_ggtt(struct xe_bo *bo)
> +{
> +	int ret;
> +
> +	ret = xe_bo_restore_pinned(bo);
> +	if (ret)
> +		return ret;
> +
> +	return xe_bo_map_ggtt(bo);
> +}
> +
>  /**
>   * xe_bo_restore_early - restore early phase kernel BOs to VRAM
>   *
> @@ -270,7 +288,7 @@ int xe_bo_restore_late(struct xe_device *xe)
>  	return ret;
>  }
>  
> -static void xe_bo_pci_dev_remove_pinned(struct xe_device *xe)
> +void xe_bo_pci_dev_remove_pinned(struct xe_device *xe)

Same as above for kernel doc, commit message, reasoning.

Patch looks sane enough though.

Matt

>  {
>  	struct xe_tile *tile;
>  	unsigned int id;
> diff --git a/drivers/gpu/drm/xe/xe_bo_evict.h b/drivers/gpu/drm/xe/xe_bo_evict.h
> index e8385cb7f5e9..d4f5b87243e7 100644
> --- a/drivers/gpu/drm/xe/xe_bo_evict.h
> +++ b/drivers/gpu/drm/xe/xe_bo_evict.h
> @@ -14,7 +14,9 @@ int xe_bo_notifier_prepare_all_pinned(struct xe_device *xe);
>  void xe_bo_notifier_unprepare_all_pinned(struct xe_device *xe);
>  int xe_bo_restore_early(struct xe_device *xe);
>  int xe_bo_restore_late(struct xe_device *xe);
> +int xe_bo_restore_map(struct xe_device *xe);
>  
> +void xe_bo_pci_dev_remove_pinned(struct xe_device *xe);
>  void xe_bo_pci_dev_remove_all(struct xe_device *xe);
>  
>  int xe_bo_pinned_init(struct xe_device *xe);
> -- 
> 2.43.0
> 

  reply	other threads:[~2026-02-24 22:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 10:25 [PATCH v1 0/6] Introduce Xe PCIe FLR Raag Jadav
2026-02-24 10:25 ` [PATCH v1 1/6] drm/xe/uc_fw: Allow reloading firmware Raag Jadav
2026-02-24 10:25 ` [PATCH v1 2/6] drm/xe/uc: Introduce FLR helpers Raag Jadav
2026-02-24 10:25 ` [PATCH v1 3/6] drm/xe/irq: Introduce FLR helper Raag Jadav
2026-02-24 10:25 ` [PATCH v1 4/6] drm/xe: Introduce xe_device_assert_lmem_ready() Raag Jadav
2026-02-24 10:25 ` [PATCH v1 5/6] drm/xe/bo_evict: Introduce xe_bo_restore_map() Raag Jadav
2026-02-24 22:11   ` Matthew Brost [this message]
2026-02-26 12:13     ` Raag Jadav
2026-02-24 10:25 ` [PATCH v1 6/6] drm/xe/pci: Introduce PCIe FLR Raag Jadav
2026-02-26 16:42   ` Maarten Lankhorst
2026-02-26 16:46     ` Raag Jadav
2026-02-26 16:55       ` Raag Jadav
2026-02-24 10:36 ` ✗ CI.checkpatch: warning for Introduce Xe " Patchwork
2026-02-24 10:38 ` ✓ CI.KUnit: success " Patchwork
2026-02-26 10:28 ` [PATCH v1 0/6] " Jani Nikula
2026-02-26 12:31   ` Raag Jadav
2026-02-26 16:08 ` Matthew Auld
2026-02-26 16:37   ` Raag Jadav
2026-02-26 22:12 ` Matt Roper
2026-02-27  4:18   ` Raag Jadav

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=aZ4iGmnnvHK2fZ9M@lstrano-desk.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=michal.winiarski@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@linux.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