Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Tomasz Lis <tomasz.lis@intel.com>
Cc: intel-xe@lists.freedesktop.org,
	"Michał Winiarski" <michal.winiarski@intel.com>,
	"Michał Wajdeczko" <michal.wajdeczko@intel.com>,
	"Piotr Piórkowski" <piotr.piorkowski@intel.com>
Subject: Re: [PATCH v2 1/4] drm/xe/vf: Fix GuC FW check for VF migration support
Date: Wed, 15 Oct 2025 19:58:29 -0700	[thread overview]
Message-ID: <aPBfVRjz5AraRGsM@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20251015002755.720992-2-tomasz.lis@intel.com>

On Wed, Oct 15, 2025 at 02:27:52AM +0200, Tomasz Lis wrote:
> The check was done before GuC ABI version could be acquired.
> Comparing only to zeros provides very stable results, though
> not the ones expected.
> 
> This change dislodged part of the VF migration support check
> and moved it to after GuC handshake.
> 

I thought the handshake has performed as part of read_gmdid earlier in
the driver probe. Still confused by how this got broke but anyways, I
can confirm this fixed the VF probe issue:

Tested-by: Matthew Brost <matthew.brost@intel.com>

As I'm confused, I'll leave the RB to someone else.

Matt

> Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 44 +++++++++++++++++++++++++++++
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.h |  1 +
>  drivers/gpu/drm/xe/xe_guc.c         |  2 ++
>  drivers/gpu/drm/xe/xe_sriov_vf.c    | 10 -------
>  4 files changed, 47 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 46518e629ba3..95c10de0732f 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> @@ -314,6 +314,50 @@ static int guc_action_vf_notify_resfix_done(struct xe_guc *guc)
>  	return ret > 0 ? -EPROTO : ret;
>  }
>  
> +static void vf_disable_migration(struct xe_gt *gt, const char *fmt, ...)
> +{
> +	struct xe_device *xe = gt_to_xe(gt);
> +	struct va_format vaf;
> +	va_list va_args;
> +
> +	xe_gt_assert(gt, IS_SRIOV_VF(xe));
> +
> +	va_start(va_args, fmt);
> +	vaf.fmt = fmt;
> +	vaf.va  = &va_args;
> +	xe_gt_sriov_notice(gt, "migration disabled: %pV\n", &vaf);
> +	va_end(va_args);
> +
> +	xe->sriov.vf.migration.enabled = false;
> +}
> +
> +#define NEEDS_SW_CCS_MIGRATION_WA(xe) \
> +	((xe)->info.platform == XE_PANTHERLAKE)
> +
> +/**
> + * xe_gt_sriov_vf_guc_check_migration_support - Check for disable migration due to GuC.
> + * @gt: the &xe_gt struct instance linked to target GuC
> + *
> + * Performs late disable of VF migration feature in case GuC FW cannot support it.
> + */
> +void xe_gt_sriov_vf_guc_check_migration_support(struct xe_gt *gt)
> +{
> +	struct xe_device *xe = gt_to_xe(gt);
> +
> +	if (!xe_sriov_vf_migration_supported(xe))
> +		return;
> +
> +	if (NEEDS_SW_CCS_MIGRATION_WA(xe)) {
> +		struct xe_uc_fw_version guc_version;
> +
> +		xe_gt_sriov_vf_guc_versions(gt, NULL, &guc_version);
> +		if (MAKE_GUC_VER_STRUCT(guc_version) < MAKE_GUC_VER(1, 23, 0))
> +			return vf_disable_migration(gt,
> +				"CCS migration requires GuC ABI >= 1.23 but only %u.%u found",
> +				guc_version.major, guc_version.minor);
> +	}
> +}
> +
>  /**
>   * vf_notify_resfix_done - Notify GuC about resource fixups apply completed.
>   * @gt: the &xe_gt struct instance linked to target GuC
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.h b/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
> index af40276790fa..60a3b9b05b20 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
> @@ -26,6 +26,7 @@ void xe_gt_sriov_vf_migrated_event_handler(struct xe_gt *gt);
>  int xe_gt_sriov_vf_init_early(struct xe_gt *gt);
>  int xe_gt_sriov_vf_init(struct xe_gt *gt);
>  bool xe_gt_sriov_vf_recovery_pending(struct xe_gt *gt);
> +void xe_gt_sriov_vf_guc_check_migration_support(struct xe_gt *gt);
>  
>  u32 xe_gt_sriov_vf_gmdid(struct xe_gt *gt);
>  u16 xe_gt_sriov_vf_guc_ids(struct xe_gt *gt);
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index d94490979adc..3c4e64233b3a 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -713,6 +713,8 @@ static int vf_guc_init_noalloc(struct xe_guc *guc)
>  	if (err)
>  		return err;
>  
> +	xe_gt_sriov_vf_guc_check_migration_support(gt);
> +
>  	err = xe_gt_sriov_vf_query_config(gt);
>  	if (err)
>  		return err;
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf.c b/drivers/gpu/drm/xe/xe_sriov_vf.c
> index 911d5720917b..5fb042c05112 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf.c
> @@ -163,16 +163,6 @@ static void vf_migration_init_early(struct xe_device *xe)
>  		return vf_disable_migration(xe, "requires gfx version >= 20, but only %u found",
>  					    GRAPHICS_VER(xe));
>  
> -	if (!IS_DGFX(xe)) {
> -		struct xe_uc_fw_version guc_version;
> -
> -		xe_gt_sriov_vf_guc_versions(xe_device_get_gt(xe, 0), NULL, &guc_version);
> -		if (MAKE_GUC_VER_STRUCT(guc_version) < MAKE_GUC_VER(1, 23, 0))
> -			return vf_disable_migration(xe,
> -						    "CCS migration requires GuC ABI >= 1.23 but only %u.%u found",
> -						    guc_version.major, guc_version.minor);
> -	}
> -
>  	xe->sriov.vf.migration.enabled = true;
>  	xe_sriov_dbg(xe, "migration support enabled\n");
>  }
> -- 
> 2.25.1
> 

  reply	other threads:[~2025-10-16  2:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15  0:27 [PATCH v2 0/4] drm/xe/vf: Minor fixes to post-migration recovery Tomasz Lis
2025-10-15  0:27 ` [PATCH v2 1/4] drm/xe/vf: Fix GuC FW check for VF migration support Tomasz Lis
2025-10-16  2:58   ` Matthew Brost [this message]
2025-10-15  0:27 ` [PATCH v2 2/4] drm/xe/vf: Skip fixups on VF migration before getting GGTT info Tomasz Lis
2025-10-15  0:27 ` [PATCH v2 3/4] drm/xe: Assert that VF will never use fixed placement of BOs Tomasz Lis
2025-10-15  0:27 ` [PATCH v2 4/4] drm/xe/vf: Do not disable VF migration on ATS-M Tomasz Lis
2025-10-15  0:33 ` ✓ CI.KUnit: success for drm/xe/vf: Minor fixes to post-migration recovery (rev2) Patchwork
2025-10-15  1:13 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-15 13:02 ` ✗ Xe.CI.Full: failure " 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=aPBfVRjz5AraRGsM@lstrano-desk.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=michal.winiarski@intel.com \
    --cc=piotr.piorkowski@intel.com \
    --cc=tomasz.lis@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