Commit bd58904a authored by Tomas Winkler's avatar Tomas Winkler Committed by Daniele Ceraolo Spurio

mei: pxp: support matching with a gfx discrete card

With on-boards graphics card, both i915 and MEI
are in the same device hierarchy with the same parent,
while for discrete gfx card the MEI is its child device.
Adjust the match function for that scenario
by matching MEI parent device with i915.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Vitaly Lubart <vitaly.lubart@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarAlan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220928004145.745803-7-daniele.ceraolospurio@intel.com
parent c7289125
...@@ -156,17 +156,24 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent, ...@@ -156,17 +156,24 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent,
{ {
struct device *base = data; struct device *base = data;
if (!dev)
return 0;
if (!dev->driver || strcmp(dev->driver->name, "i915") || if (!dev->driver || strcmp(dev->driver->name, "i915") ||
subcomponent != I915_COMPONENT_PXP) subcomponent != I915_COMPONENT_PXP)
return 0; return 0;
base = base->parent; base = base->parent;
if (!base) if (!base) /* mei device */
return 0; return 0;
base = base->parent; base = base->parent; /* pci device */
dev = dev->parent; /* for dgfx */
if (base && dev == base)
return 1;
/* for pch */
dev = dev->parent;
return (base && dev && dev == base); return (base && dev && dev == base);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment