aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/i5100_edac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/i5100_edac.c')
-rw-r--r--drivers/edac/i5100_edac.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
index d55e5529734c..6c0dafa3f67b 100644
--- a/drivers/edac/i5100_edac.c
+++ b/drivers/edac/i5100_edac.c
@@ -428,12 +428,16 @@ static void i5100_handle_ce(struct mem_ctl_info *mci,
428 const char *msg) 428 const char *msg)
429{ 429{
430 const int csrow = i5100_rank_to_csrow(mci, chan, rank); 430 const int csrow = i5100_rank_to_csrow(mci, chan, rank);
431 char *label = NULL;
432
433 if (mci->csrows[csrow].channels[0].dimm)
434 label = mci->csrows[csrow].channels[0].dimm->label;
431 435
432 printk(KERN_ERR 436 printk(KERN_ERR
433 "CE chan %d, bank %u, rank %u, syndrome 0x%lx, " 437 "CE chan %d, bank %u, rank %u, syndrome 0x%lx, "
434 "cas %u, ras %u, csrow %u, label \"%s\": %s\n", 438 "cas %u, ras %u, csrow %u, label \"%s\": %s\n",
435 chan, bank, rank, syndrome, cas, ras, 439 chan, bank, rank, syndrome, cas, ras,
436 csrow, mci->csrows[csrow].channels[0].dimm->label, msg); 440 csrow, label, msg);
437 441
438 mci->ce_count++; 442 mci->ce_count++;
439 mci->csrows[csrow].ce_count++; 443 mci->csrows[csrow].ce_count++;
@@ -450,12 +454,16 @@ static void i5100_handle_ue(struct mem_ctl_info *mci,
450 const char *msg) 454 const char *msg)
451{ 455{
452 const int csrow = i5100_rank_to_csrow(mci, chan, rank); 456 const int csrow = i5100_rank_to_csrow(mci, chan, rank);
457 char *label = NULL;
458
459 if (mci->csrows[csrow].channels[0].dimm)
460 label = mci->csrows[csrow].channels[0].dimm->label;
453 461
454 printk(KERN_ERR 462 printk(KERN_ERR
455 "UE chan %d, bank %u, rank %u, syndrome 0x%lx, " 463 "UE chan %d, bank %u, rank %u, syndrome 0x%lx, "
456 "cas %u, ras %u, csrow %u, label \"%s\": %s\n", 464 "cas %u, ras %u, csrow %u, label \"%s\": %s\n",
457 chan, bank, rank, syndrome, cas, ras, 465 chan, bank, rank, syndrome, cas, ras,
458 csrow, mci->csrows[csrow].channels[0].dimm->label, msg); 466 csrow, label, msg);
459 467
460 mci->ue_count++; 468 mci->ue_count++;
461 mci->csrows[csrow].ue_count++; 469 mci->csrows[csrow].ue_count++;
@@ -837,6 +845,7 @@ static void __devinit i5100_init_csrows(struct mem_ctl_info *mci)
837 int i; 845 int i;
838 unsigned long total_pages = 0UL; 846 unsigned long total_pages = 0UL;
839 struct i5100_priv *priv = mci->pvt_info; 847 struct i5100_priv *priv = mci->pvt_info;
848 struct dimm_info *dimm;
840 849
841 for (i = 0; i < mci->nr_csrows; i++) { 850 for (i = 0; i < mci->nr_csrows; i++) {
842 const unsigned long npages = i5100_npages(mci, i); 851 const unsigned long npages = i5100_npages(mci, i);
@@ -852,27 +861,22 @@ static void __devinit i5100_init_csrows(struct mem_ctl_info *mci)
852 */ 861 */
853 mci->csrows[i].first_page = total_pages; 862 mci->csrows[i].first_page = total_pages;
854 mci->csrows[i].last_page = total_pages + npages - 1; 863 mci->csrows[i].last_page = total_pages + npages - 1;
855 mci->csrows[i].page_mask = 0UL;
856
857 mci->csrows[i].nr_pages = npages; 864 mci->csrows[i].nr_pages = npages;
858 mci->csrows[i].grain = 32;
859 mci->csrows[i].csrow_idx = i; 865 mci->csrows[i].csrow_idx = i;
860 mci->csrows[i].dtype =
861 (priv->mtr[chan][rank].width == 4) ? DEV_X4 : DEV_X8;
862 mci->csrows[i].ue_count = 0;
863 mci->csrows[i].ce_count = 0;
864 mci->csrows[i].mtype = MEM_RDDR2;
865 mci->csrows[i].edac_mode = EDAC_SECDED;
866 mci->csrows[i].mci = mci; 866 mci->csrows[i].mci = mci;
867 mci->csrows[i].nr_channels = 1; 867 mci->csrows[i].nr_channels = 1;
868 mci->csrows[i].channels[0].chan_idx = 0;
869 mci->csrows[i].channels[0].ce_count = 0;
870 mci->csrows[i].channels[0].csrow = mci->csrows + i; 868 mci->csrows[i].channels[0].csrow = mci->csrows + i;
871 snprintf(mci->csrows[i].channels[0].dimm->label,
872 sizeof(mci->csrows[i].channels[0].dimm->label),
873 "DIMM%u", i5100_rank_to_slot(mci, chan, rank));
874
875 total_pages += npages; 869 total_pages += npages;
870
871 dimm = mci->csrows[i].channels[0].dimm;
872 dimm->grain = 32;
873 dimm->dtype = (priv->mtr[chan][rank].width == 4) ?
874 DEV_X4 : DEV_X8;
875 dimm->mtype = MEM_RDDR2;
876 dimm->edac_mode = EDAC_SECDED;
877 snprintf(dimm->label, sizeof(dimm->label),
878 "DIMM%u",
879 i5100_rank_to_slot(mci, chan, rank));
876 } 880 }
877} 881}
878 882