diff options
author | David E. Box <david.e.box@linux.intel.com> | 2025-07-02 19:28:21 -0700 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-07-03 11:09:28 +0300 |
commit | e4436e98672c7993cdfd7743efd0fcaa8df7cc17 (patch) | |
tree | 492374d28e49b787bcf4f91005d6c2def5513e3b /drivers/platform/x86/intel/vsec.c | |
parent | 1f3855ea7d6b03f68c2eec7a0bcd537cedcc6680 (diff) |
platform/x86/intel/vsec: Skip driverless features
If a feature lacks a corresponding driver and that feature is also a
supplier, registering it would be prevent the consumer driver from probing.
Introduces logic to skip such features during device registration.
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20250703022832.1302928-7-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>
Diffstat (limited to 'drivers/platform/x86/intel/vsec.c')
-rw-r--r-- | drivers/platform/x86/intel/vsec.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index 32f777b41b33..30e558af6888 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -123,6 +123,26 @@ get_consumer_dependencies(struct vsec_priv *priv, int cap_id) return NULL; } +static bool vsec_driver_present(int cap_id) +{ + unsigned long bit = BIT(cap_id); + + switch (bit) { + case VSEC_CAP_TELEMETRY: + return IS_ENABLED(CONFIG_INTEL_PMT_TELEMETRY); + case VSEC_CAP_WATCHER: + return IS_ENABLED(CONFIG_INTEL_PMT_WATCHER); + case VSEC_CAP_CRASHLOG: + return IS_ENABLED(CONFIG_INTEL_PMT_CRASHLOG); + case VSEC_CAP_SDSI: + return IS_ENABLED(CONFIG_INTEL_SDSI); + case VSEC_CAP_TPMI: + return IS_ENABLED(CONFIG_INTEL_TPMI); + default: + return false; + } +} + /* * Although pci_device_id table is available in the pdev, this prototype is * necessary because the code using it can be called by an exported API that @@ -158,7 +178,8 @@ static int intel_vsec_link_devices(struct pci_dev *pdev, struct device *dev, for_each_set_bit(supplier_id, &deps->supplier_bitmap, VSEC_FEATURE_COUNT) { struct device_link *link; - if (state[supplier_id] != STATE_REGISTERED) + if (state[supplier_id] != STATE_REGISTERED || + !vsec_driver_present(supplier_id)) continue; if (!suppliers[supplier_id]) { @@ -405,6 +426,11 @@ static int intel_vsec_register_device(struct pci_dev *pdev, priv->found_caps |= BIT(cap_id); + if (!vsec_driver_present(cap_id)) { + priv->state[cap_id] = STATE_SKIP; + return -ENODEV; + } + consumer_deps = get_consumer_dependencies(priv, cap_id); if (!consumer_deps || suppliers_ready(priv, consumer_deps, cap_id)) { ret = intel_vsec_add_dev(pdev, header, info, cap_id); |