The intel GFX drivers (i915/xe) interface with the ME device for some of
their features (e.g. PXP, HDCP) via the component interface. Given that
the ME device can be hidden by BIOS/Coreboot, the GFX drivers need a
way to check if the device is available before attempting to bind the
component, otherwise they'll go ahead and initialize features that will
never work.
The simplest way to check if the ME device is available is to check the
available devices against the PCI ID list of the mei_me driver. To avoid
duplication, this patch exports the list, so that it can be used directly
from the GFX drivers.
Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Cc: Alexander Usyskin <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
---
drivers/misc/mei/pci-me.c | 12 +++++++++++-
include/linux/mei_me.h | 15 +++++++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
create mode 100644 include/linux/mei_me.h
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index b017ff29dbd1..632756f9da66 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -18,6 +18,7 @@
#include <linux/pm_runtime.h>
#include <linux/mei.h>
+#include <linux/mei_me.h>
#include "mei_dev.h"
#include "client.h"
@@ -25,7 +26,7 @@
#include "hw-me.h"
/* mei_pci_tbl - PCI Device ID Table */
-static const struct pci_device_id mei_me_pci_tbl[] = {
+const struct pci_device_id mei_me_pci_tbl[] = {
{MEI_PCI_DEVICE(MEI_DEV_ID_82946GZ, MEI_ME_ICH_CFG)},
{MEI_PCI_DEVICE(MEI_DEV_ID_82G35, MEI_ME_ICH_CFG)},
{MEI_PCI_DEVICE(MEI_DEV_ID_82Q965, MEI_ME_ICH_CFG)},
@@ -135,6 +136,15 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, mei_me_pci_tbl);
+/*
+ * Other drivers (e.g., i915, xe) interface with the ME device for some of
their
+ * features (e.g., PXP, HDCP). However, the ME device can be unplugged via the
+ * pci subsystem or hidden by BIOS/coreboot, so those drivers might want to
+ * check if the device is available before initializing those features. To
+ * allow them to perform such a check, we export the list of ME device IDs.
+ */
+EXPORT_SYMBOL_GPL(mei_me_pci_tbl);