drm/xe: Move SR-IOV probe to xe_device_probe_early()
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 27 Mar 2024 18:27:39 +0000 (19:27 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 28 Mar 2024 12:45:35 +0000 (13:45 +0100)
SR-IOV mode detection requires access to the MMIO register and
this can be done now in xe_device_probe_early().

We can also drop explicit has_sriov parameter as this flag is now
already available from xe->info.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240327182740.407-3-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_sriov.c
drivers/gpu/drm/xe/xe_sriov.h

index 286ebccc3fc81c4e251043b3251f6ef2fabd3ea8..01bd5ccf05ca6a10f37a5b01d185af720d9c05fa 100644 (file)
@@ -424,6 +424,8 @@ int xe_device_probe_early(struct xe_device *xe)
        if (err)
                return err;
 
+       xe_sriov_probe_early(xe);
+
        err = xe_mmio_verify_vram(xe);
        if (err)
                return err;
index c401d4890386d9ca78ca3d9cdefc957b0f2c5b45..7ce37b28bfa4eedd3c88c5d69d9c5b6b23c5f1e4 100644 (file)
@@ -738,8 +738,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (err)
                return err;
 
-       xe_sriov_probe_early(xe, desc->has_sriov);
-
        err = xe_device_probe_early(xe);
        if (err)
                return err;
index f295d91886b129f3222352bd7ec81bd30e037b94..2bcef998c8a98c777e8b1973dbcc0e7ab63711d3 100644 (file)
@@ -31,7 +31,6 @@ const char *xe_sriov_mode_to_string(enum xe_sriov_mode mode)
 /**
  * xe_sriov_probe_early - Probe a SR-IOV mode.
  * @xe: the &xe_device to probe mode on
- * @has_sriov: flag indicating hardware support for SR-IOV
  *
  * This function should be called only once and as soon as possible during
  * driver probe to detect whether we are running a SR-IOV Physical Function
@@ -40,9 +39,10 @@ const char *xe_sriov_mode_to_string(enum xe_sriov_mode mode)
  * SR-IOV PF mode detection is based on PCI @dev_is_pf() function.
  * SR-IOV VF mode detection is based on dedicated MMIO register read.
  */
-void xe_sriov_probe_early(struct xe_device *xe, bool has_sriov)
+void xe_sriov_probe_early(struct xe_device *xe)
 {
        enum xe_sriov_mode mode = XE_SRIOV_MODE_NONE;
+       bool has_sriov = xe->info.has_sriov;
 
        /* TODO: replace with proper mode detection */
        xe_assert(xe, !has_sriov);
index 1545552162c9e8b619936c2b734cb51cca410fff..9e3f58874e9804d3580d1e1941463325e6de644a 100644 (file)
@@ -12,7 +12,7 @@
 
 const char *xe_sriov_mode_to_string(enum xe_sriov_mode mode);
 
-void xe_sriov_probe_early(struct xe_device *xe, bool has_sriov);
+void xe_sriov_probe_early(struct xe_device *xe);
 int xe_sriov_init(struct xe_device *xe);
 
 static inline enum xe_sriov_mode xe_device_sriov_mode(struct xe_device *xe)