[PATCH 4/4] untested crap

Lucas De Marchi lucas.demarchi at intel.com
Thu Oct 4 00:14:15 UTC 2018


or... x86/early-quirks: use 32bits reads on PCI

Do like it's done in drivers/pci/probe.c?

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 arch/x86/kernel/early-quirks.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 50d5848bf22e..acca93d9c738 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -584,7 +584,7 @@ static void __init intel_graphics_quirks(int num, int slot, int func)
 	u16 device;
 	int i;
 
-	device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID);
+	device = read_pci_config(num, slot, func, PCI_VENDOR_ID) >> 16;
 
 	for (i = 0; i < ARRAY_SIZE(intel_early_ids); i++) {
 		kernel_ulong_t driver_data = intel_early_ids[i].driver_data;
@@ -727,6 +727,7 @@ static void __init early_pci_scan_bus(int bus);
  */
 static int __init check_dev_quirk(int num, int slot, int func)
 {
+	u32 val;
 	u16 class;
 	u16 vendor;
 	u16 device;
@@ -734,14 +735,15 @@ static int __init check_dev_quirk(int num, int slot, int func)
 	u8 sec;
 	int i;
 
-	class = read_pci_config_16(num, slot, func, PCI_CLASS_DEVICE);
+	val = read_pci_config(num, slot, func, PCI_CLASS_REVISION);
+	class = val >> 16;
 
 	if (class == 0xffff)
 		return -1; /* no class, treat as single function */
 
-	vendor = read_pci_config_16(num, slot, func, PCI_VENDOR_ID);
-
-	device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID);
+	val = read_pci_config(num, slot, func, PCI_VENDOR_ID);
+	vendor = val & 0xffff;
+	device = val >> 16;
 
 	for (i = 0; early_qrk[i].f != NULL; i++) {
 		if (((early_qrk[i].vendor == PCI_ANY_ID) ||
-- 
2.17.1



More information about the Intel-gfx-trybot mailing list