[Intel-gfx] [PATCH 06/15] mei: pxp: support matching with a gfx discrete card

Daniele Ceraolo Spurio daniele.ceraolospurio at intel.com
Thu Jun 9 23:19:46 UTC 2022


From: Tomas Winkler <tomas.winkler at intel.com>

Support matching with a discrete graphics card.

Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
Cc: Vitaly Lubart <vitaly.lubart at intel.com>
---
 drivers/misc/mei/pxp/mei_pxp.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c
index 94d3ef3cc73a..645862f4bb38 100644
--- a/drivers/misc/mei/pxp/mei_pxp.c
+++ b/drivers/misc/mei/pxp/mei_pxp.c
@@ -162,13 +162,20 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent,
 	    subcomponent != I915_COMPONENT_PXP)
 		return 0;
 
-	base = base->parent;
-	if (!base)
+	if (!dev)
 		return 0;
 
 	base = base->parent;
-	dev = dev->parent;
+	if (!base) /* mei device */
+		return 0;
 
+	base = base->parent; /* pci device */
+	/* for dgfx */
+	if (base && dev == base)
+		return 1;
+
+	/* for pch */
+	dev = dev->parent;
 	return (base && dev && dev == base);
 }
 
-- 
2.25.1



More information about the Intel-gfx mailing list