mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/5] mei: hdcp/pxp: adapt for Xe driver
@ 2023-11-14 10:08 Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 1/5] Revert "mei/hdcp: Also enable for XE" Alexander Usyskin
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Alexander Usyskin @ 2023-11-14 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lucas De Marchi, Daniele Ceraolo Spurio,
	Rodrigo Vivi
  Cc: Tomas Winkler, Alexander Usyskin, Vitaly Lubart, intel-xe, linux-kernel

Update mei-hdcp and mei-pxp drivers to work with Xe driver
alongside with i195 driver.
Revert previous partial attempt.
Update match functions to match without driver name
and update module dependencies to optionally depend on Xe.

GregKH: this series intended to bake and merge through drm-xe tree
where Xe driver is developed.

V2:
 - drop first empty line cleanup, will be sent separately
 - add commit message to revert patch

Alexander Usyskin (5):
  Revert "mei/hdcp: Also enable for XE"
  mei: hdcp: match without driver name
  mei: pxp: match without driver name
  mei: hdcp: add dependency on Xe driver
  mei: pxp: add dependency on Xe driver

 drivers/misc/mei/hdcp/mei_hdcp.c | 15 ++++++++++++---
 drivers/misc/mei/pxp/Kconfig     |  2 +-
 drivers/misc/mei/pxp/mei_pxp.c   | 14 ++++++++++++--
 3 files changed, 25 insertions(+), 6 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/5] Revert "mei/hdcp: Also enable for XE"
  2023-11-14 10:08 [PATCH v2 0/5] mei: hdcp/pxp: adapt for Xe driver Alexander Usyskin
@ 2023-11-14 10:08 ` Alexander Usyskin
  2023-11-14 12:12   ` Greg Kroah-Hartman
  2023-11-14 10:08 ` [PATCH v2 2/5] mei: hdcp: match without driver name Alexander Usyskin
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Alexander Usyskin @ 2023-11-14 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lucas De Marchi, Daniele Ceraolo Spurio,
	Rodrigo Vivi
  Cc: Tomas Winkler, Alexander Usyskin, Vitaly Lubart, intel-xe, linux-kernel

This reverts commit 62db7d00efe48c614b006086f306d5addedf8f83.

It will be replaced by match without driver name.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/misc/mei/hdcp/Kconfig    | 2 +-
 drivers/misc/mei/hdcp/mei_hdcp.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/mei/hdcp/Kconfig b/drivers/misc/mei/hdcp/Kconfig
index 2ac9148988d4..54e1c9526909 100644
--- a/drivers/misc/mei/hdcp/Kconfig
+++ b/drivers/misc/mei/hdcp/Kconfig
@@ -4,7 +4,7 @@
 config INTEL_MEI_HDCP
 	tristate "Intel HDCP2.2 services of ME Interface"
 	select INTEL_MEI_ME
-	depends on DRM_I915 || DRM_XE
+	depends on DRM_I915
 	help
 	  MEI Support for HDCP2.2 Services on Intel platforms.
 
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index 94beb5667faa..51359cc5ece9 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -782,8 +782,7 @@ static int mei_hdcp_component_match(struct device *dev, int subcomponent,
 {
 	struct device *base = data;
 
-	if (!dev->driver ||
-	    (strcmp(dev->driver->name, "i915") && strcmp(dev->driver->name, "xe")) ||
+	if (!dev->driver || strcmp(dev->driver->name, "i915") ||
 	    subcomponent != I915_COMPONENT_HDCP)
 		return 0;
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/5] mei: hdcp: match without driver name
  2023-11-14 10:08 [PATCH v2 0/5] mei: hdcp/pxp: adapt for Xe driver Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 1/5] Revert "mei/hdcp: Also enable for XE" Alexander Usyskin
@ 2023-11-14 10:08 ` Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 3/5] mei: pxp: " Alexander Usyskin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Usyskin @ 2023-11-14 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lucas De Marchi, Daniele Ceraolo Spurio,
	Rodrigo Vivi
  Cc: Tomas Winkler, Alexander Usyskin, Vitaly Lubart, intel-xe, linux-kernel

Remove dependency on i915 driver name in component_match function.
Use PCI header information to match Intel graphics device.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/misc/mei/hdcp/mei_hdcp.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index 51359cc5ece9..f8759a6c9ed3 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -17,6 +17,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/mei.h>
 #include <linux/mei_cl_bus.h>
@@ -781,9 +782,18 @@ static int mei_hdcp_component_match(struct device *dev, int subcomponent,
 				    void *data)
 {
 	struct device *base = data;
+	struct pci_dev *pdev;
 
-	if (!dev->driver || strcmp(dev->driver->name, "i915") ||
-	    subcomponent != I915_COMPONENT_HDCP)
+	if (!dev_is_pci(dev))
+		return 0;
+
+	pdev = to_pci_dev(dev);
+
+	if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
+	    pdev->vendor != PCI_VENDOR_ID_INTEL)
+		return 0;
+
+	if (subcomponent != I915_COMPONENT_HDCP)
 		return 0;
 
 	base = base->parent;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 3/5] mei: pxp: match without driver name
  2023-11-14 10:08 [PATCH v2 0/5] mei: hdcp/pxp: adapt for Xe driver Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 1/5] Revert "mei/hdcp: Also enable for XE" Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 2/5] mei: hdcp: match without driver name Alexander Usyskin
@ 2023-11-14 10:08 ` Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 4/5] mei: hdcp: add dependency on Xe driver Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 5/5] mei: pxp: " Alexander Usyskin
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Usyskin @ 2023-11-14 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lucas De Marchi, Daniele Ceraolo Spurio,
	Rodrigo Vivi
  Cc: Tomas Winkler, Alexander Usyskin, Vitaly Lubart, intel-xe, linux-kernel

Remove dependency on i915 driver name in component_match function.
Use PCI header information to match Intel graphics device.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/misc/mei/pxp/mei_pxp.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c
index 2dcb9169e404..e74b2facfdf9 100644
--- a/drivers/misc/mei/pxp/mei_pxp.c
+++ b/drivers/misc/mei/pxp/mei_pxp.c
@@ -12,6 +12,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/mei.h>
 #include <linux/mei_cl_bus.h>
@@ -154,12 +155,21 @@ static int mei_pxp_component_match(struct device *dev, int subcomponent,
 				   void *data)
 {
 	struct device *base = data;
+	struct pci_dev *pdev;
 
 	if (!dev)
 		return 0;
 
-	if (!dev->driver || strcmp(dev->driver->name, "i915") ||
-	    subcomponent != I915_COMPONENT_PXP)
+	if (!dev_is_pci(dev))
+		return 0;
+
+	pdev = to_pci_dev(dev);
+
+	if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
+	    pdev->vendor != PCI_VENDOR_ID_INTEL)
+		return 0;
+
+	if (subcomponent != I915_COMPONENT_PXP)
 		return 0;
 
 	base = base->parent;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 4/5] mei: hdcp: add dependency on Xe driver
  2023-11-14 10:08 [PATCH v2 0/5] mei: hdcp/pxp: adapt for Xe driver Alexander Usyskin
                   ` (2 preceding siblings ...)
  2023-11-14 10:08 ` [PATCH v2 3/5] mei: pxp: " Alexander Usyskin
@ 2023-11-14 10:08 ` Alexander Usyskin
  2023-11-14 10:08 ` [PATCH v2 5/5] mei: pxp: " Alexander Usyskin
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Usyskin @ 2023-11-14 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lucas De Marchi, Daniele Ceraolo Spurio,
	Rodrigo Vivi
  Cc: Tomas Winkler, Alexander Usyskin, Vitaly Lubart, intel-xe, linux-kernel

Optionally depend on either i915 or Xe drivers.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/misc/mei/hdcp/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mei/hdcp/Kconfig b/drivers/misc/mei/hdcp/Kconfig
index 54e1c9526909..2ac9148988d4 100644
--- a/drivers/misc/mei/hdcp/Kconfig
+++ b/drivers/misc/mei/hdcp/Kconfig
@@ -4,7 +4,7 @@
 config INTEL_MEI_HDCP
 	tristate "Intel HDCP2.2 services of ME Interface"
 	select INTEL_MEI_ME
-	depends on DRM_I915
+	depends on DRM_I915 || DRM_XE
 	help
 	  MEI Support for HDCP2.2 Services on Intel platforms.
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 5/5] mei: pxp: add dependency on Xe driver
  2023-11-14 10:08 [PATCH v2 0/5] mei: hdcp/pxp: adapt for Xe driver Alexander Usyskin
                   ` (3 preceding siblings ...)
  2023-11-14 10:08 ` [PATCH v2 4/5] mei: hdcp: add dependency on Xe driver Alexander Usyskin
@ 2023-11-14 10:08 ` Alexander Usyskin
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Usyskin @ 2023-11-14 10:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lucas De Marchi, Daniele Ceraolo Spurio,
	Rodrigo Vivi
  Cc: Tomas Winkler, Alexander Usyskin, Vitaly Lubart, intel-xe, linux-kernel

Optionally depend on either i915 or Xe drivers.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/misc/mei/pxp/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mei/pxp/Kconfig b/drivers/misc/mei/pxp/Kconfig
index 4029b96afc04..fb9b278c4016 100644
--- a/drivers/misc/mei/pxp/Kconfig
+++ b/drivers/misc/mei/pxp/Kconfig
@@ -5,7 +5,7 @@
 config INTEL_MEI_PXP
 	tristate "Intel PXP services of ME Interface"
 	select INTEL_MEI_ME
-	depends on DRM_I915
+	depends on DRM_I915 || DRM_XE
 	help
 	  MEI Support for PXP Services on Intel platforms.
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/5] Revert "mei/hdcp: Also enable for XE"
  2023-11-14 10:08 ` [PATCH v2 1/5] Revert "mei/hdcp: Also enable for XE" Alexander Usyskin
@ 2023-11-14 12:12   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2023-11-14 12:12 UTC (permalink / raw)
  To: Alexander Usyskin
  Cc: Lucas De Marchi, Daniele Ceraolo Spurio, Rodrigo Vivi,
	Tomas Winkler, Vitaly Lubart, intel-xe, linux-kernel

On Tue, Nov 14, 2023 at 12:08:39PM +0200, Alexander Usyskin wrote:
> This reverts commit 62db7d00efe48c614b006086f306d5addedf8f83.
> 
> It will be replaced by match without driver name.

Again, you are saying _what_ you are doing, but not _why_ you are doing
this.  I have no clue why this current matching is not acceptable.

And did you just break the existing code if only this patch is applied?

> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>

As I asked this same question last review cycle, I'm now going to be
very picky and say "You are not following the documented Intel procedure
for Linux kernel patches that Greg has to review."  Please work with
your internal Intel kernel developers to fix this, otherwise we can not
take them at all, sorry.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-14 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-14 10:08 [PATCH v2 0/5] mei: hdcp/pxp: adapt for Xe driver Alexander Usyskin
2023-11-14 10:08 ` [PATCH v2 1/5] Revert "mei/hdcp: Also enable for XE" Alexander Usyskin
2023-11-14 12:12   ` Greg Kroah-Hartman
2023-11-14 10:08 ` [PATCH v2 2/5] mei: hdcp: match without driver name Alexander Usyskin
2023-11-14 10:08 ` [PATCH v2 3/5] mei: pxp: " Alexander Usyskin
2023-11-14 10:08 ` [PATCH v2 4/5] mei: hdcp: add dependency on Xe driver Alexander Usyskin
2023-11-14 10:08 ` [PATCH v2 5/5] mei: pxp: " Alexander Usyskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®