diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-11-30 05:14:30 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-01 08:01:49 -0400 |
commit | 4055759145b421537207ed0d034041f1774ab41d (patch) | |
tree | 9819fc092edb4fed369ebf6a7767174fdf484f4f | |
parent | f9902f24fc2d6bcc836622aa70e77f7f9dfb30a9 (diff) |
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: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/edac/i7core_edac.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 304f550ed8d..6ae7795dea8 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -2226,7 +2226,7 @@ fail0: | |||
2226 | static int __devinit i7core_probe(struct pci_dev *pdev, | 2226 | static int __devinit i7core_probe(struct pci_dev *pdev, |
2227 | const struct pci_device_id *id) | 2227 | const struct pci_device_id *id) |
2228 | { | 2228 | { |
2229 | int rc; | 2229 | int rc, count = 0; |
2230 | struct i7core_dev *i7core_dev; | 2230 | struct i7core_dev *i7core_dev; |
2231 | 2231 | ||
2232 | /* get the pci devices we want to reserve for our use */ | 2232 | /* 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 | goto fail0; | 2246 | goto fail0; |
2247 | 2247 | ||
2248 | list_for_each_entry(i7core_dev, &i7core_edac_list, list) { | 2248 | list_for_each_entry(i7core_dev, &i7core_edac_list, list) { |
2249 | count++; | ||
2249 | rc = i7core_register_mci(i7core_dev); | 2250 | rc = i7core_register_mci(i7core_dev); |
2250 | if (unlikely(rc < 0)) | 2251 | if (unlikely(rc < 0)) |
2251 | goto fail1; | 2252 | goto fail1; |
2252 | } | 2253 | } |
2253 | 2254 | ||
2254 | i7core_printk(KERN_INFO, "Driver loaded.\n"); | 2255 | /* |
2256 | * Nehalem-EX uses a different memory controller. However, as the | ||
2257 | * memory controller is not visible on some Nehalem/Nehalem-EP, we | ||
2258 | * need to indirectly probe via a X58 PCI device. The same devices | ||
2259 | * are found on (some) Nehalem-EX. So, on those machines, the | ||
2260 | * probe routine needs to return -ENODEV, as the actual Memory | ||
2261 | * Controller registers won't be detected. | ||
2262 | */ | ||
2263 | if (!count) { | ||
2264 | rc = -ENODEV; | ||
2265 | goto fail1; | ||
2266 | } | ||
2267 | |||
2268 | i7core_printk(KERN_INFO, | ||
2269 | "Driver loaded, %d memory controller(s) found.\n", | ||
2270 | count); | ||
2255 | 2271 | ||
2256 | mutex_unlock(&i7core_edac_lock); | 2272 | mutex_unlock(&i7core_edac_lock); |
2257 | return 0; | 2273 | return 0; |