On Tue, Sep 09, 2025 at 04:50:41AM +0000, Usyskin, Alexander wrote:
>+static int mei_lb_component_match(struct device *dev, int subcomponent,
>+                             void *data)
>+{
>+   /*
>+    * This function checks if requester is Intel %PCI_CLASS_DISPLAY_VGA
or
>+    * %PCI_CLASS_DISPLAY_OTHER device, and checks if the requester is
the
>+    * grand parent of mei_if i.e. late bind MEI device
>+    */
>+   struct device *base = data;
>+   struct pci_dev *pdev;
>+
>+   if (!dev)
>+           return 0;
>+
>+   if (!dev_is_pci(dev))
>+           return 0;
>+
>+   pdev = to_pci_dev(dev);
>+
>+   if (pdev->vendor != PCI_VENDOR_ID_INTEL)
>+           return 0;
>+
>+   if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) &&
>+       pdev->class != (PCI_CLASS_DISPLAY_OTHER << 8))

this doesn't seem right, we should allow other PCI classes. AFAICS this
check could just be removed and just leave the INTEL_COMPONENT_LB below
to protect for component match

Lucas De Marchi


The subcomponent is unique only in its own instance of the component framework.
Or I'm wrong here?
We have to ensure that we have Intel display device, not any other device to
subcomponent check to work correctly.

We are matching by child-parent relationship + the component id. So you
have both the mei device and another pci device that added that specific
subcomponent and both need to have a common parent. Thinking about
another device that would match the parent-child relationship:  audio,
but audio doesn't add that.

what scenario would cause a false match that I'm not seeing?

Lucas De Marchi

Reply via email to