From: Tomasz Lis <tomasz.lis@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Michał Winiarski" <michal.winiarski@intel.com>,
"Michał Wajdeczko" <michal.wajdeczko@intel.com>
Subject: [PATCH v6 4/5] drm/xe/vf: Start post-migration fixups with provisinoning query
Date: Mon, 4 Nov 2024 22:34:48 +0100 [thread overview]
Message-ID: <20241104213449.1455694-5-tomasz.lis@intel.com> (raw)
In-Reply-To: <20241104213449.1455694-1-tomasz.lis@intel.com>
During post-migration recovery, only MMIO communication to GuC is
allowed. The VF KMD needs to use that channel to ask for the new
provisioning, which includes a new GGTT range assigned to the VF.
v2: query config only instead of handshake; no need to get pm ref as
it's now kept through whole recovery (Michal)
v3: switched names of 'err' and 'ret' (Michal)
Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
---
drivers/gpu/drm/xe/xe_sriov_vf.c | 36 ++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_sriov_vf.c b/drivers/gpu/drm/xe/xe_sriov_vf.c
index db9441f303f5..954177e5333f 100644
--- a/drivers/gpu/drm/xe/xe_sriov_vf.c
+++ b/drivers/gpu/drm/xe/xe_sriov_vf.c
@@ -25,6 +25,31 @@ void xe_sriov_vf_init_early(struct xe_device *xe)
INIT_WORK(&xe->sriov.vf.migration.worker, migration_worker_func);
}
+/**
+ * vf_post_migration_requery_guc - Re-query GuC for current VF provisioning.
+ * @xe: the &xe_device struct instance
+ *
+ * After migration, we need to re-query all VF configuration to make sure
+ * they match previous provisioning. Note that most of VF provisioning
+ * shall be the same, except GGTT range, since GGTT is not virtualized per-VF.
+ *
+ * Returns: 0 if the operation completed successfully, or a negative error
+ * code otherwise.
+ */
+static int vf_post_migration_requery_guc(struct xe_device *xe)
+{
+ struct xe_gt *gt;
+ unsigned int id;
+ int err, ret = 0;
+
+ for_each_gt(gt, xe, id) {
+ err = xe_gt_sriov_vf_query_config(gt);
+ ret = ret ?: err;
+ }
+
+ return ret;
+}
+
/*
* Notify all GuCs about resource fixups apply finished.
*/
@@ -40,12 +65,23 @@ static void vf_post_migration_notify_resfix_done(struct xe_device *xe)
static void vf_post_migration_recovery(struct xe_device *xe)
{
+ int err;
+
drm_dbg(&xe->drm, "migration recovery in progress\n");
xe_pm_runtime_get(xe);
+ err = vf_post_migration_requery_guc(xe);
+ if (unlikely(err))
+ goto fail;
+
/* FIXME: add the recovery steps */
vf_post_migration_notify_resfix_done(xe);
xe_pm_runtime_put(xe);
drm_notice(&xe->drm, "migration recovery ended\n");
+ return;
+fail:
+ xe_pm_runtime_put(xe);
+ drm_err(&xe->drm, "migration recovery failed (%pe)\n", ERR_PTR(err));
+ xe_device_declare_wedged(xe);
}
static void migration_worker_func(struct work_struct *w)
--
2.25.1
next prev parent reply other threads:[~2024-11-04 21:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 21:34 [PATCH v6 0/5] drm/xe/vf: Post-migration recovery worker basis Tomasz Lis
2024-11-04 21:34 ` [PATCH v6 1/5] drm/xe/vf: React to MIGRATED interrupt Tomasz Lis
2024-11-04 21:34 ` [PATCH v6 2/5] drm/xe/vf: Document SRIOV VF restore flow Tomasz Lis
2024-11-06 14:15 ` [PATCH v3 " Michal Wajdeczko
2024-11-04 21:34 ` [PATCH v6 3/5] drm/xe/vf: Send RESFIX_DONE message at end of VF restore Tomasz Lis
2024-11-04 21:34 ` Tomasz Lis [this message]
2024-11-04 21:34 ` [PATCH v6 5/5] drm/xe/vf: Defer fixups if migrated twice fast Tomasz Lis
2024-11-05 0:35 ` ✓ CI.Patch_applied: success for drm/xe/vf: Post-migration recovery worker basis (rev6) Patchwork
2024-11-05 0:35 ` ✗ CI.checkpatch: warning " Patchwork
2024-11-05 0:36 ` ✓ CI.KUnit: success " Patchwork
2024-11-05 0:48 ` ✓ CI.Build: " Patchwork
2024-11-05 0:50 ` ✓ CI.Hooks: " Patchwork
2024-11-05 0:51 ` ✓ CI.checksparse: " Patchwork
2024-11-05 1:13 ` ✓ CI.BAT: " Patchwork
2024-11-06 1:10 ` ✗ CI.FULL: failure " Patchwork
2024-11-06 13:09 ` [PATCH v6 0/5] drm/xe/vf: Post-migration recovery worker basis Michal Wajdeczko
2024-11-06 14:33 ` Michal Wajdeczko
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=20241104213449.1455694-5-tomasz.lis@intel.com \
--to=tomasz.lis@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