Commit 40557591 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

i7core_edac: return -ENODEV if no MC is found

Nehalem-EX uses a different memory controller. However, as the
memory controller is not visible on some Nehalem/Nehalem-EP, we
need to indirectly probe via a X58 PCI device. The same devices
are found on (some) Nehalem-EX. So, on those machines, the
probe routine needs to return -ENODEV, as the actual Memory
Controller registers won't be detected.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f9902f24
...@@ -2226,7 +2226,7 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev) ...@@ -2226,7 +2226,7 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev)
static int __devinit i7core_probe(struct pci_dev *pdev, static int __devinit i7core_probe(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
int rc; int rc, count = 0;
struct i7core_dev *i7core_dev; struct i7core_dev *i7core_dev;
/* get the pci devices we want to reserve for our use */ /* get the pci devices we want to reserve for our use */
...@@ -2246,12 +2246,28 @@ static int __devinit i7core_probe(struct pci_dev *pdev, ...@@ -2246,12 +2246,28 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
goto fail0; goto fail0;
list_for_each_entry(i7core_dev, &i7core_edac_list, list) { list_for_each_entry(i7core_dev, &i7core_edac_list, list) {
count++;
rc = i7core_register_mci(i7core_dev); rc = i7core_register_mci(i7core_dev);
if (unlikely(rc < 0)) if (unlikely(rc < 0))
goto fail1; goto fail1;
} }
i7core_printk(KERN_INFO, "Driver loaded.\n"); /*
* Nehalem-EX uses a different memory controller. However, as the
* memory controller is not visible on some Nehalem/Nehalem-EP, we
* need to indirectly probe via a X58 PCI device. The same devices
* are found on (some) Nehalem-EX. So, on those machines, the
* probe routine needs to return -ENODEV, as the actual Memory
* Controller registers won't be detected.
*/
if (!count) {
rc = -ENODEV;
goto fail1;
}
i7core_printk(KERN_INFO,
"Driver loaded, %d memory controller(s) found.\n",
count);
mutex_unlock(&i7core_edac_lock); mutex_unlock(&i7core_edac_lock);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment