We want to split up GUC init to an alloc and noalloc part to keep the
init path the same for VF and !VF as much as possible.
Everything in vf_guc_init should be done as early as possible, otherwise
VRAM probing becomes impossible.
Also move xe_gt_mmio_init to the end of xe_gt_init_early(), cleaning up
the init in xe_device slightly.
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20250619104858.418440-15-dev@lankhorst.se
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
err = xe_gt_init_early(gt);
if (err)
return err;
-
- /*
- * Only after this point can GT-specific MMIO operations
- * (including things like communication with the GuC)
- * be performed.
- */
- xe_gt_mmio_init(gt);
-
- if (IS_SRIOV_VF(xe)) {
- xe_guc_comm_init_early(>->uc.guc);
- err = xe_gt_sriov_vf_bootstrap(gt);
- if (err)
- return err;
- err = xe_gt_sriov_vf_query_config(gt);
- if (err)
- return err;
- }
}
for_each_tile(tile, xe, id) {
xe_mocs_init_early(gt);
+ /*
+ * Only after this point can GT-specific MMIO operations
+ * (including things like communication with the GuC)
+ * be performed.
+ */
+ xe_gt_mmio_init(gt);
+
return 0;
}
struct vf_runtime_reg *rr;
xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt)));
- xe_gt_assert(gt, gt->sriov.vf.pf_version.major);
xe_gt_assert(gt, !reg.vf);
if (reg.addr == GMD_ID.addr) {
static int vf_guc_init(struct xe_guc *guc)
{
+ struct xe_gt *gt = guc_to_gt(guc);
int err;
xe_guc_comm_init_early(guc);
if (err)
return err;
+ err = xe_gt_sriov_vf_bootstrap(gt);
+ if (err)
+ return err;
+
+ err = xe_gt_sriov_vf_query_config(gt);
+ if (err)
+ return err;
+
return 0;
}