[PATCH] pci: maxreadreq: skip Intel video devices

Alex Hung alex.hung at canonical.com
Mon Nov 30 18:37:14 UTC 2020


Intel usually, if not always, makes this register read-only.

Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/lib/include/fwts_pci.h      | 2 ++
 src/pci/maxreadreq/maxreadreq.c | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/src/lib/include/fwts_pci.h b/src/lib/include/fwts_pci.h
index 8aaa2b66..799c150a 100644
--- a/src/lib/include/fwts_pci.h
+++ b/src/lib/include/fwts_pci.h
@@ -151,6 +151,8 @@
 #define FWTS_PCI_SUBCLASS_CODE_OTHER_SYSTEM_PERIPHERAL	(0x80)
 #define FWTS_PCI_SUBCLASS_CODE_AUDIO_DEVICE		(0x03)
 
+/* PCI Vendor IDs */
+#define FWTS_PCI_INTEL_VENDOR_ID			(0x8086)
 
 /*
  * PCI Express Capability Structure is defined in Section 7.8
diff --git a/src/pci/maxreadreq/maxreadreq.c b/src/pci/maxreadreq/maxreadreq.c
index a54a343f..9115c947 100644
--- a/src/pci/maxreadreq/maxreadreq.c
+++ b/src/pci/maxreadreq/maxreadreq.c
@@ -63,6 +63,7 @@ static int maxreadreq_test1(fwts_framework *fw)
 		int fd;
 		ssize_t n;
 		uint8_t offset = 0;
+		uint16_t vendor_id;
 
 		if (entry->d_name[0] == '.')
 			continue;
@@ -97,6 +98,12 @@ static int maxreadreq_test1(fwts_framework *fw)
 		    (config[FWTS_PCI_CONFIG_SUBCLASS] == FWTS_PCI_SUBCLASS_CODE_AUDIO_DEVICE))
 			continue;
 
+		/* Ignore Intel's Video Device */
+		vendor_id = config[FWTS_PCI_CONFIG_VENDOR_ID] + ((config[FWTS_PCI_CONFIG_VENDOR_ID  + 1]) << 8);
+		if ((config[FWTS_PCI_CONFIG_CLASS_CODE] == FWTS_PCI_CLASS_CODE_DISPLAY_CONTROLLER) &&
+		    (vendor_id == FWTS_PCI_INTEL_VENDOR_ID))
+			continue;
+
 		/* config region too small, do next */
 		if (n < FWTS_PCI_CONFIG_TYPE0_CAPABILITIES_POINTER)
 			continue;
-- 
2.25.1




More information about the fwts-devel mailing list