Commit d79c88c4 authored by Michal Wajdeczko's avatar Michal Wajdeczko

drm/xe: Move SR-IOV probe to xe_device_probe_early()

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: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240327182740.407-3-michal.wajdeczko@intel.com
parent 451d261a
...@@ -424,6 +424,8 @@ int xe_device_probe_early(struct xe_device *xe) ...@@ -424,6 +424,8 @@ int xe_device_probe_early(struct xe_device *xe)
if (err) if (err)
return err; return err;
xe_sriov_probe_early(xe);
err = xe_mmio_verify_vram(xe); err = xe_mmio_verify_vram(xe);
if (err) if (err)
return err; return err;
......
...@@ -738,8 +738,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -738,8 +738,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err) if (err)
return err; return err;
xe_sriov_probe_early(xe, desc->has_sriov);
err = xe_device_probe_early(xe); err = xe_device_probe_early(xe);
if (err) if (err)
return err; return err;
......
...@@ -31,7 +31,6 @@ const char *xe_sriov_mode_to_string(enum xe_sriov_mode mode) ...@@ -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_sriov_probe_early - Probe a SR-IOV mode.
* @xe: the &xe_device to probe mode on * @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 * 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 * 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) ...@@ -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 PF mode detection is based on PCI @dev_is_pf() function.
* SR-IOV VF mode detection is based on dedicated MMIO register read. * 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; enum xe_sriov_mode mode = XE_SRIOV_MODE_NONE;
bool has_sriov = xe->info.has_sriov;
/* TODO: replace with proper mode detection */ /* TODO: replace with proper mode detection */
xe_assert(xe, !has_sriov); xe_assert(xe, !has_sriov);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
const char *xe_sriov_mode_to_string(enum xe_sriov_mode mode); 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); int xe_sriov_init(struct xe_device *xe);
static inline enum xe_sriov_mode xe_device_sriov_mode(struct xe_device *xe) static inline enum xe_sriov_mode xe_device_sriov_mode(struct xe_device *xe)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment