i7core_edac: Probe on Xeons eariler

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, June 4, 2010 - 4:01 pm

Gitweb:     http://git.kernel.org/linus/bc2d7245ff1c5466c877a0c32a7ec9563187a032
Commit:     bc2d7245ff1c5466c877a0c32a7ec9563187a032
Parent:     14d2c08343eecd13f6c6ec232c98b16762b97924
Author:     Keith Mannthey <kmannth@us.ibm.com>
AuthorDate: Thu Sep 3 00:05:05 2009 -0300
Committer:  Mauro Carvalho Chehab <mchehab@redhat.com>
CommitDate: Mon May 10 11:44:57 2010 -0300

    i7core_edac: Probe on Xeons eariler
    
    On the Xeon 55XX series cpus the pci deives are not exposed via acpi so
    we much explicitly probe them to make the usable as a Linux PCI device.
    
    This moves the detection of this state to before pci_register_driver is
    called.  Its present position was not working on my systems, the driver
    would complain about not finding a specific device.
    
    This patch allows the driver to load on my systems.
    
    Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/edac/i7core_edac.c |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 9f4e9d7..9fe7ec7 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1158,6 +1158,23 @@ static void i7core_put_devices(void)
 			pci_dev_put(pci_devs[j].pdev[i]);
 }
 
+static void i7core_xeon_pci_fixup(void)
+{
+	struct pci_dev *pdev = NULL;
+	int i;
+	/*
+	 * On Xeon 55xx, the Intel Quckpath Arch Generic Non-core pci buses
+	 * aren't announced by acpi. So, we need to use a legacy scan probing
+	 * to detect them
+	 */
+	pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
+			      pci_devs[0].dev_id, NULL);
+	if (unlikely(!pdev)) {
+		for (i = 0; i < NUM_SOCKETS; i ++)
+			pcibios_scan_specific_bus(255-i);
+	}
+}
+
 /*
  *	i7core_get_devices	Find and perform 'get' operation on the MCH's
  *			device/functions we want to reference for this driver
@@ -1174,19 +1191,6 @@ int i7core_get_onedevice(struct pci_dev **prev, int devno)
 			      pci_devs[devno].dev_id, *prev);
 
 	/*
-	 * On Xeon 55xx, the Intel Quckpath Arch Generic Non-core pci buses
-	 * aren't announced by acpi. So, we need to use a legacy scan probing
-	 * to detect them
-	 */
-	if (unlikely(!pdev && !devno && !prev)) {
-		pcibios_scan_specific_bus(254);
-		pcibios_scan_specific_bus(255);
-
-		pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
-				      pci_devs[devno].dev_id, *prev);
-	}
-
-	/*
 	 * On Xeon 55xx, the Intel Quckpath Arch Generic Non-core regs
 	 * is at addr 8086:2c40, instead of 8086:2c41. So, we need
 	 * to probe for the alternate address in case of failure
@@ -1896,6 +1900,8 @@ static int __init i7core_init(void)
 	/* Ensure that the OPSTATE is set correctly for POLL or NMI */
 	opstate_init();
 
+	i7core_xeon_pci_fixup();
+
 	pci_rc = pci_register_driver(&i7core_driver);
 
 	if (pci_rc >= 0)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
i7core_edac: Probe on Xeons eariler, Linux Kernel Mailing ..., (Fri Jun 4, 4:01 pm)