]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/sriov: Move VF bootstrap and query_config to vf_guc_init
authorMaarten Lankhorst <dev@lankhorst.se>
Thu, 19 Jun 2025 10:49:01 +0000 (12:49 +0200)
committerMaarten Lankhorst <dev@lankhorst.se>
Thu, 26 Jun 2025 20:07:44 +0000 (22:07 +0200)
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>
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_gt.c
drivers/gpu/drm/xe/xe_gt_sriov_vf.c
drivers/gpu/drm/xe/xe_guc.c

index d66cb82c43453d2c0b1e0972b769c6dd17466f96..f56677d3f0dca76a8624dbe3be06c059436e88b8 100644 (file)
@@ -792,23 +792,6 @@ int xe_device_probe(struct xe_device *xe)
                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(&gt->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) {
index 9752a38c0162af2ddf8693d6fe31846e4e459ad6..4370a4db95e051d683275dd024c7e9a7f5e51c74 100644 (file)
@@ -419,6 +419,13 @@ int xe_gt_init_early(struct xe_gt *gt)
 
        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;
 }
 
index 9b2fc9db55b8c698c13277176194f212cf378d5d..93cd26dca070fe812dc2405bf37ee6119f05338e 100644 (file)
@@ -966,7 +966,6 @@ u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg)
        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) {
index 209e5d53c290c7f5d5402aaaded61b273745f1aa..81b22b6fb2493ba363eb5890a79d729a64f67917 100644 (file)
@@ -629,6 +629,7 @@ static int xe_guc_realloc_post_hwconfig(struct xe_guc *guc)
 
 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);
@@ -641,6 +642,14 @@ static int vf_guc_init(struct xe_guc *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;
 }