]> git.ipfire.org Git - thirdparty/linux.git/commit
platform/x86/intel/vsec: Add device links to enforce dependencies
authorDavid E. Box <david.e.box@linux.intel.com>
Thu, 3 Jul 2025 02:28:19 +0000 (19:28 -0700)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 3 Jul 2025 08:09:25 +0000 (11:09 +0300)
commit8a67d4b49bbdebcd255abde9e652092c3de3b657
tree6f13cba823bd957ac2fe10103956a5ef5e838879
parentb0631f8a5740c55b52d02174cc4c9c84cc7a16a1
platform/x86/intel/vsec: Add device links to enforce dependencies

New Intel VSEC features will have dependencies on other features, requiring
certain supplier drivers to be probed before their consumers. To enforce
this dependency ordering, introduce device links using device_link_add(),
ensuring that suppliers are fully registered before consumers are probed.

- Add device link tracking by storing supplier devices and tracking their
  state.
- Implement intel_vsec_link_devices() to establish links between suppliers
  and consumers based on feature dependencies.
- Add get_consumer_dependencies() to retrieve supplier-consumer
  relationships.
- Modify feature registration logic:
  * Consumers now check that all required suppliers are registered before
    being initialized.
  * suppliers_ready() verifies that all required supplier devices are
    available.
- Prevent potential null consumer name issue in sysfs:
  - Use dev_set_name() when creating auxiliary devices to ensure a
    unique, non-null consumer name.
- Update intel_vsec_pci_probe() to loop up to the number of possible
  features or when all devices are registered, whichever comes first.
- Introduce VSEC_CAP_UNUSED to prevent sub-features (registered via
  exported APIs) from being mistakenly linked.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20250703022832.1302928-5-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>
drivers/platform/x86/intel/vsec.c
include/linux/intel_vsec.h