diff options
author | David E. Box <david.e.box@linux.intel.com> | 2025-07-02 19:28:20 -0700 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-07-03 11:09:26 +0300 |
commit | 1f3855ea7d6b03f68c2eec7a0bcd537cedcc6680 (patch) | |
tree | 4e5fd08f3503daa1eef3783d98ff5abeb1203409 | |
parent | 8a67d4b49bbdebcd255abde9e652092c3de3b657 (diff) |
platform/x86/intel/vsec: Skip absent features during initialization
Some VSEC features depend on the presence of supplier features that may not
always be present. To prevent unnecessary retries and device linking during
initialization, introduce logic to skip attempts to link consumers to
missing suppliers.
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20250703022832.1302928-6-david.e.box@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-rw-r--r-- | drivers/platform/x86/intel/vsec.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index aa1f7e63039d0..32f777b41b337 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -568,11 +568,30 @@ static bool intel_vsec_get_features(struct pci_dev *pdev, return found; } +static void intel_vsec_skip_missing_dependencies(struct pci_dev *pdev) +{ + struct vsec_priv *priv = pci_get_drvdata(pdev); + const struct vsec_feature_dependency *deps = priv->info->deps; + int consumer_id = priv->info->num_deps; + + while (consumer_id--) { + int supplier_id; + + deps = &priv->info->deps[consumer_id]; + + for_each_set_bit(supplier_id, &deps->supplier_bitmap, VSEC_FEATURE_COUNT) { + if (!(BIT(supplier_id) & priv->found_caps)) + priv->state[supplier_id] = STATE_SKIP; + } + } +} + static int intel_vsec_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct intel_vsec_platform_info *info; struct vsec_priv *priv; int num_caps, ret; + int run_once = 0; bool found_any = false; ret = pcim_enable_device(pdev); @@ -597,6 +616,11 @@ static int intel_vsec_pci_probe(struct pci_dev *pdev, const struct pci_device_id if (priv->found_caps == info->caps) break; + + if (!run_once) { + intel_vsec_skip_missing_dependencies(pdev); + run_once = 1; + } } if (!found_any) |