aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/sb_edac.c
diff options
context:
space:
mode:
authorLuck, Tony <tony.luck@intel.com>2013-03-28 12:59:15 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-29 09:32:40 -0400
commitde4772c621487fd4cadb4138f2481297c8e0cb0d (patch)
tree074895ee1887707634c372397959ec03e3be2eec /drivers/edac/sb_edac.c
parent33ad41263da5df8ac55d4010a015063ff88712e8 (diff)
edac: sb_edac.c should not require prescence of IMC_DDRIO device
The Sandy Bridge EDAC driver uses a register in the IMC_DDRIO CSR space to determine the type of DIMMs (registered or unregistered). But this device does not exist on some single socket Sandy Bridge servers. While the type of DIMMs is nice to know, it is not essential for this driver's other functions. So it seems harsh to have it refuse to load at all when it cannot find this device. Make the check for this device be optional. If it isn't present just report the memory type as "MEM_UNKNOWN". Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/sb_edac.c')
-rw-r--r--drivers/edac/sb_edac.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 57244f995614..e04462b60756 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -331,30 +331,31 @@ struct sbridge_pvt {
331 u64 tolm, tohm; 331 u64 tolm, tohm;
332}; 332};
333 333
334#define PCI_DESCR(device, function, device_id) \ 334#define PCI_DESCR(device, function, device_id, opt) \
335 .dev = (device), \ 335 .dev = (device), \
336 .func = (function), \ 336 .func = (function), \
337 .dev_id = (device_id) 337 .dev_id = (device_id), \
338 .optional = opt
338 339
339static const struct pci_id_descr pci_dev_descr_sbridge[] = { 340static const struct pci_id_descr pci_dev_descr_sbridge[] = {
340 /* Processor Home Agent */ 341 /* Processor Home Agent */
341 { PCI_DESCR(14, 0, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0) }, 342 { PCI_DESCR(14, 0, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0, 0) },
342 343
343 /* Memory controller */ 344 /* Memory controller */
344 { PCI_DESCR(15, 0, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA) }, 345 { PCI_DESCR(15, 0, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA, 0) },
345 { PCI_DESCR(15, 1, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_RAS) }, 346 { PCI_DESCR(15, 1, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_RAS, 0) },
346 { PCI_DESCR(15, 2, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD0) }, 347 { PCI_DESCR(15, 2, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD0, 0) },
347 { PCI_DESCR(15, 3, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD1) }, 348 { PCI_DESCR(15, 3, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD1, 0) },
348 { PCI_DESCR(15, 4, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD2) }, 349 { PCI_DESCR(15, 4, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD2, 0) },
349 { PCI_DESCR(15, 5, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD3) }, 350 { PCI_DESCR(15, 5, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD3, 0) },
350 { PCI_DESCR(17, 0, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_DDRIO) }, 351 { PCI_DESCR(17, 0, PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_DDRIO, 1) },
351 352
352 /* System Address Decoder */ 353 /* System Address Decoder */
353 { PCI_DESCR(12, 6, PCI_DEVICE_ID_INTEL_SBRIDGE_SAD0) }, 354 { PCI_DESCR(12, 6, PCI_DEVICE_ID_INTEL_SBRIDGE_SAD0, 0) },
354 { PCI_DESCR(12, 7, PCI_DEVICE_ID_INTEL_SBRIDGE_SAD1) }, 355 { PCI_DESCR(12, 7, PCI_DEVICE_ID_INTEL_SBRIDGE_SAD1, 0) },
355 356
356 /* Broadcast Registers */ 357 /* Broadcast Registers */
357 { PCI_DESCR(13, 6, PCI_DEVICE_ID_INTEL_SBRIDGE_BR) }, 358 { PCI_DESCR(13, 6, PCI_DEVICE_ID_INTEL_SBRIDGE_BR, 0) },
358}; 359};
359 360
360#define PCI_ID_TABLE_ENTRY(A) { .descr=A, .n_devs = ARRAY_SIZE(A) } 361#define PCI_ID_TABLE_ENTRY(A) { .descr=A, .n_devs = ARRAY_SIZE(A) }
@@ -556,14 +557,19 @@ static int get_dimm_config(struct mem_ctl_info *mci)
556 pvt->is_close_pg = false; 557 pvt->is_close_pg = false;
557 } 558 }
558 559
559 pci_read_config_dword(pvt->pci_ddrio, RANK_CFG_A, &reg); 560 if (pvt->pci_ddrio) {
560 if (IS_RDIMM_ENABLED(reg)) { 561 pci_read_config_dword(pvt->pci_ddrio, RANK_CFG_A, &reg);
561 /* FIXME: Can also be LRDIMM */ 562 if (IS_RDIMM_ENABLED(reg)) {
562 edac_dbg(0, "Memory is registered\n"); 563 /* FIXME: Can also be LRDIMM */
563 mtype = MEM_RDDR3; 564 edac_dbg(0, "Memory is registered\n");
565 mtype = MEM_RDDR3;
566 } else {
567 edac_dbg(0, "Memory is unregistered\n");
568 mtype = MEM_DDR3;
569 }
564 } else { 570 } else {
565 edac_dbg(0, "Memory is unregistered\n"); 571 edac_dbg(0, "Cannot determine memory type\n");
566 mtype = MEM_DDR3; 572 mtype = MEM_UNKNOWN;
567 } 573 }
568 574
569 /* On all supported DDR3 DIMM types, there are 8 banks available */ 575 /* On all supported DDR3 DIMM types, there are 8 banks available */
@@ -1303,8 +1309,7 @@ static int mci_bind_devs(struct mem_ctl_info *mci,
1303 1309
1304 /* Check if everything were registered */ 1310 /* Check if everything were registered */
1305 if (!pvt->pci_sad0 || !pvt->pci_sad1 || !pvt->pci_ha0 || 1311 if (!pvt->pci_sad0 || !pvt->pci_sad1 || !pvt->pci_ha0 ||
1306 !pvt-> pci_tad || !pvt->pci_ras || !pvt->pci_ta || 1312 !pvt-> pci_tad || !pvt->pci_ras || !pvt->pci_ta)
1307 !pvt->pci_ddrio)
1308 goto enodev; 1313 goto enodev;
1309 1314
1310 for (i = 0; i < NUM_CHANNELS; i++) { 1315 for (i = 0; i < NUM_CHANNELS; i++) {