mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-21 13:45:53 -04:00
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>
This commit is contained in:
committed by
Ilpo Järvinen
parent
8a67d4b49b
commit
1f3855ea7d
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user