]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/sriov: Disable SR-IOV if primary GT is disabled via configfs
authorMatt Roper <matthew.d.roper@intel.com>
Mon, 13 Oct 2025 20:10:06 +0000 (13:10 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 14 Oct 2025 14:45:28 +0000 (07:45 -0700)
SR-IOV operation relies on the primary GT's GuC to operate (in both PF
and VF mode).  Don't enable the .has_sriov flag if the primary-GT was
disabled by configfs.

v2:
 - Move handling to xe_info_init().  (Michal)

v3:
 - Just update the .has_sriov flag in xe_info_init_early().  (Michal)

v4:
 - Drop unnecessary comment.  (Michal)
 - Flip condition order for consistency with other checks.  (Michal)

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://lore.kernel.org/r/20251013200944.2499947-48-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_pci.c

index 8c12db455eef9fb8c84003fbaac5446d5e90b4fb..0f1a06b62e03f8e1dd80452d52f048cf063aa116 100644 (file)
@@ -629,7 +629,8 @@ static int xe_info_init_early(struct xe_device *xe,
        xe->info.has_late_bind = desc->has_late_bind;
        xe->info.has_llc = desc->has_llc;
        xe->info.has_pxp = desc->has_pxp;
-       xe->info.has_sriov = desc->has_sriov;
+       xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
+               desc->has_sriov;
        xe->info.skip_guc_pc = desc->skip_guc_pc;
        xe->info.skip_mtcfg = desc->skip_mtcfg;
        xe->info.skip_pcode = desc->skip_pcode;