[PATCH v6 2/9] drm/xe/vf: Skip fixups on migration before getting GGTT info

Michał Winiarski michal.winiarski at intel.com
Wed Jul 16 11:53:52 UTC 2025


On Fri, Jul 04, 2025 at 11:02:21PM +0200, Tomasz Lis wrote:
> The RESFIX state should be achievable only after a successful
> handshake. If VF KMD has no GGTT configuration yet and we still got
> into RESFIX state, then either we're dealing with unclean initial
> state due to unusual actions before probe, or the migration
> happened while xe init (started by probe) was running.
> 
> In 1st case (migration before probe), we should just skip migration -
> init procedure will ensure exit from RESFIX state as it starts GuC
> handshake with a reset.
> 
> In 2nd case (migration during xe init), the migration procedure should
> execute normally if GGTT configuration was already acquired from GuC,
> and can be skipped if it was not acquired.
> 
> Signed-off-by: Tomasz Lis <tomasz.lis at intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Michal Winiarski <michal.winiarski at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 93cd26dca070..591ce84223c1 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> @@ -762,6 +762,15 @@ void xe_gt_sriov_vf_migrated_event_handler(struct xe_gt *gt)
>  
>  	xe_gt_assert(gt, IS_SRIOV_VF(xe));
>  
> +	if (!gt->sriov.vf.self_config.ggtt_size) {
> +		/*
> +		 * If driver initialization is running in parallel to this handler,
> +		 * and it did not reached acquiring GGTT config yet, then ignore
> +		 * the migration - init procedure will create the GGTT at new place.
> +		 */
> +		return;
> +	}

If driver initialization is running in parallel to this handler - we're
missing serialization for gt->sriov.vf.self_config.ggtt_size

-Michał

> +
>  	set_bit(gt->info.id, &xe->sriov.vf.migration.gt_flags);
>  	/*
>  	 * We need to be certain that if all flags were set, at least one
> -- 
> 2.25.1
> 


More information about the Intel-xe mailing list