]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/mocs: Initialize MOCS index early
authorBalasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Tue, 20 May 2025 14:24:45 +0000 (19:54 +0530)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 29 May 2025 21:29:18 +0000 (14:29 -0700)
MOCS uc_index is used even before it is initialized in the following
callstack
    guc_prepare_xfer()
    __xe_guc_upload()
    xe_guc_min_load_for_hwconfig()
    xe_uc_init_hwconfig()
    xe_gt_init_hwconfig()

Do MOCS index initialization earlier in the device probe.

Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Reviewed-by: Ravi Kumar Vodapalli <ravi.kumar.vodapalli@intel.com>
Link: https://lore.kernel.org/r/20250520142445.2792824-1-balasubramani.vivekanandan@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_gt.c

index 0e5d243c94517b57b4841f32afc6e4d869033b5f..858b5398c01b791a2f642638fdfe54103f4746ed 100644 (file)
@@ -417,6 +417,8 @@ int xe_gt_init_early(struct xe_gt *gt)
        if (err)
                return err;
 
+       xe_mocs_init_early(gt);
+
        return 0;
 }
 
@@ -634,8 +636,6 @@ int xe_gt_init(struct xe_gt *gt)
        if (err)
                return err;
 
-       xe_mocs_init_early(gt);
-
        err = xe_gt_sysfs_init(gt);
        if (err)
                return err;