aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-15 08:02:32 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-10 10:44:52 -0400
commitba6c5c62eeb877da638e43f1282f778432142eec (patch)
tree227ff1f2c04469b6b995eafedb6e4ea6b01fc584 /drivers/edac
parent67166af4abc11d9c0deb497ebe0b562f69c71942 (diff)
i7core_edac: maps all sockets as if ther are one MC controller
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/i7core_edac.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 69eacc1b50d7..a93ebdf9c121 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -409,12 +409,12 @@ static int i7core_get_active_channels(u8 socket, unsigned *channels,
409 return 0; 409 return 0;
410} 410}
411 411
412static int get_dimm_config(struct mem_ctl_info *mci, u8 socket) 412static int get_dimm_config(struct mem_ctl_info *mci, int *csrow, u8 socket)
413{ 413{
414 struct i7core_pvt *pvt = mci->pvt_info; 414 struct i7core_pvt *pvt = mci->pvt_info;
415 struct csrow_info *csr; 415 struct csrow_info *csr;
416 struct pci_dev *pdev; 416 struct pci_dev *pdev;
417 int i, j, csrow = 0; 417 int i, j;
418 unsigned long last_page = 0; 418 unsigned long last_page = 0;
419 enum edac_type mode; 419 enum edac_type mode;
420 enum mem_type mtype; 420 enum mem_type mtype;
@@ -534,7 +534,7 @@ static int get_dimm_config(struct mem_ctl_info *mci, u8 socket)
534 npages = size << (20 - PAGE_SHIFT); 534 npages = size << (20 - PAGE_SHIFT);
535#endif 535#endif
536 536
537 csr = &mci->csrows[csrow]; 537 csr = &mci->csrows[*csrow];
538 csr->first_page = last_page + 1; 538 csr->first_page = last_page + 1;
539 last_page += npages; 539 last_page += npages;
540 csr->last_page = last_page; 540 csr->last_page = last_page;
@@ -542,7 +542,7 @@ static int get_dimm_config(struct mem_ctl_info *mci, u8 socket)
542 542
543 csr->page_mask = 0; 543 csr->page_mask = 0;
544 csr->grain = 8; 544 csr->grain = 8;
545 csr->csrow_idx = csrow; 545 csr->csrow_idx = *csrow;
546 csr->nr_channels = 1; 546 csr->nr_channels = 1;
547 547
548 csr->channels[0].chan_idx = i; 548 csr->channels[0].chan_idx = i;
@@ -565,7 +565,7 @@ static int get_dimm_config(struct mem_ctl_info *mci, u8 socket)
565 csr->edac_mode = mode; 565 csr->edac_mode = mode;
566 csr->mtype = mtype; 566 csr->mtype = mtype;
567 567
568 csrow++; 568 (*csrow)++;
569 } 569 }
570 570
571 pci_read_config_dword(pdev, MC_SAG_CH_0, &value[0]); 571 pci_read_config_dword(pdev, MC_SAG_CH_0, &value[0]);
@@ -1424,6 +1424,7 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
1424 struct i7core_pvt *pvt; 1424 struct i7core_pvt *pvt;
1425 int num_channels = 0; 1425 int num_channels = 0;
1426 int num_csrows = 0; 1426 int num_csrows = 0;
1427 int csrow = 0;
1427 int dev_idx = id->driver_data; 1428 int dev_idx = id->driver_data;
1428 int rc, i; 1429 int rc, i;
1429 u8 sockets; 1430 u8 sockets;
@@ -1495,7 +1496,7 @@ static int __devinit i7core_probe(struct pci_dev *pdev,
1495 1496
1496 /* Get dimm basic config */ 1497 /* Get dimm basic config */
1497 for (i = 0; i < sockets; i++) 1498 for (i = 0; i < sockets; i++)
1498 get_dimm_config(mci, i); 1499 get_dimm_config(mci, &csrow, i);
1499 1500
1500 /* add this new MC control structure to EDAC's list of MCs */ 1501 /* add this new MC control structure to EDAC's list of MCs */
1501 if (unlikely(edac_mc_add_mc(mci))) { 1502 if (unlikely(edac_mc_add_mc(mci))) {