From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: intel-xe@lists.freedesktop.org,
"Michał Winiarski" <michal.winiarski@intel.com>
Subject: Re: [PATCH] drm/xe/pf: Fix migration initialization
Date: Tue, 21 Jan 2025 11:19:22 -0500 [thread overview]
Message-ID: <Z4_JChiMm-GaNQa1@intel.com> (raw)
In-Reply-To: <20250120232443.544-1-michal.wajdeczko@intel.com>
On Tue, Jan 21, 2025 at 12:24:43AM +0100, Michal Wajdeczko wrote:
> The migration support only needs to be initialized once, but it
> was incorrectly called from the xe_gt_sriov_pf_init_hw(), which
> is part of the reset flow and may be called multiple times.
>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Fixes: d86e3737c7ab ("drm/xe/pf: Add functions to save and restore VF GuC state")
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt.c | 4 +++-
> drivers/gpu/drm/xe/xe_gt_sriov_pf.c | 14 +++++++++++++-
> drivers/gpu/drm/xe/xe_gt_sriov_pf.h | 6 ++++++
> 3 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index b5c313a3e946..01a4a852b8f4 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -532,8 +532,10 @@ static int all_fw_domain_init(struct xe_gt *gt)
> if (IS_SRIOV_PF(gt_to_xe(gt)) && !xe_gt_is_media_type(gt))
> xe_lmtt_init_hw(>_to_tile(gt)->sriov.pf.lmtt);
>
> - if (IS_SRIOV_PF(gt_to_xe(gt)))
> + if (IS_SRIOV_PF(gt_to_xe(gt))) {
> + xe_gt_sriov_pf_init(gt);
> xe_gt_sriov_pf_init_hw(gt);
> + }
>
> xe_force_wake_put(gt_to_fw(gt), fw_ref);
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf.c
> index e71fc3d2bda2..6f906c8e8108 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf.c
> @@ -68,6 +68,19 @@ int xe_gt_sriov_pf_init_early(struct xe_gt *gt)
> return 0;
> }
>
> +/**
> + * xe_gt_sriov_pf_init - Prepare SR-IOV PF data structures on PF.
> + * @gt: the &xe_gt to initialize
> + *
> + * Late one-time initialization of the PF data.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_gt_sriov_pf_init(struct xe_gt *gt)
> +{
> + return xe_gt_sriov_pf_migration_init(gt);
> +}
> +
> static bool pf_needs_enable_ggtt_guest_update(struct xe_device *xe)
> {
> return GRAPHICS_VERx100(xe) == 1200;
> @@ -90,7 +103,6 @@ void xe_gt_sriov_pf_init_hw(struct xe_gt *gt)
> pf_enable_ggtt_guest_update(gt);
>
> xe_gt_sriov_pf_service_update(gt);
> - xe_gt_sriov_pf_migration_init(gt);
> }
>
> static u32 pf_get_vf_regs_stride(struct xe_device *xe)
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf.h
> index 96fab779a906..f474509411c0 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf.h
> @@ -10,6 +10,7 @@ struct xe_gt;
>
> #ifdef CONFIG_PCI_IOV
> int xe_gt_sriov_pf_init_early(struct xe_gt *gt);
> +int xe_gt_sriov_pf_init(struct xe_gt *gt);
> void xe_gt_sriov_pf_init_hw(struct xe_gt *gt);
> void xe_gt_sriov_pf_sanitize_hw(struct xe_gt *gt, unsigned int vfid);
> void xe_gt_sriov_pf_restart(struct xe_gt *gt);
> @@ -19,6 +20,11 @@ static inline int xe_gt_sriov_pf_init_early(struct xe_gt *gt)
> return 0;
> }
>
> +static inline int xe_gt_sriov_pf_init(struct xe_gt *gt)
> +{
> + return 0;
> +}
> +
> static inline void xe_gt_sriov_pf_init_hw(struct xe_gt *gt)
> {
> }
> --
> 2.47.1
>
prev parent reply other threads:[~2025-01-21 16:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 23:24 [PATCH] drm/xe/pf: Fix migration initialization Michal Wajdeczko
2025-01-20 23:39 ` ✓ CI.Patch_applied: success for " Patchwork
2025-01-20 23:39 ` ✓ CI.checkpatch: " Patchwork
2025-01-20 23:41 ` ✓ CI.KUnit: " Patchwork
2025-01-20 23:57 ` ✓ CI.Build: " Patchwork
2025-01-20 23:59 ` ✓ CI.Hooks: " Patchwork
2025-01-21 0:00 ` ✓ CI.checksparse: " Patchwork
2025-01-21 0:27 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-21 1:25 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-21 20:41 ` Michal Wajdeczko
2025-01-21 16:19 ` Rodrigo Vivi [this message]
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=Z4_JChiMm-GaNQa1@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.com \
--cc=michal.winiarski@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