aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/i5100_edac.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-01-27 16:38:08 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-28 18:10:58 -0400
commit084a4fccef39ac7abb039511f32380f28d0b67e6 (patch)
tree0596612000c7ec3a848b10f7cc4acdb573218076 /drivers/edac/i5100_edac.c
parenta7d7d2e1a07e3811dc49af2962c940fd8bbb6c8f (diff)
edac: move dimm properties to struct dimm_info
On systems based on chip select rows, all channels need to use memories with the same properties, otherwise the memories on channels A and B won't be recognized. However, such assumption is not true for all types of memory controllers. Controllers for FB-DIMM's don't have such requirements. Also, modern Intel controllers seem to be capable of handling such differences. So, we need to get rid of storing the DIMM information into a per-csrow data, storing it, instead at the right place. The first step is to move grain, mtype, dtype and edac_mode to the per-dimm struct. Reviewed-by: Aristeu Rozanski <arozansk@redhat.com> Reviewed-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Chris Metcalf <cmetcalf@tilera.com> Cc: Doug Thompson <norsk5@yahoo.com> Cc: Borislav Petkov <borislav.petkov@amd.com> Cc: Mark Gross <mark.gross@intel.com> Cc: Jason Uhlenkott <juhlenko@akamai.com> Cc: Tim Small <tim@buttersideup.com> Cc: Ranganathan Desikan <ravi@jetztechnologies.com> Cc: "Arvind R." <arvino55@gmail.com> Cc: Olof Johansson <olof@lixom.net> Cc: Egor Martovetsky <egor@pasemi.com> Cc: Michal Marek <mmarek@suse.cz> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Joe Perches <joe@perches.com> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Hitoshi Mitake <h.mitake@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: James Bottomley <James.Bottomley@parallels.com> Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com> Cc: Shaohui Xie <Shaohui.Xie@freescale.com> Cc: Josh Boyer <jwboyer@gmail.com> Cc: Mike Williams <mike@mikebwilliams.com> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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