aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/i5100_edac.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-01-28 07:09:38 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-28 18:10:58 -0400
commita895bf8b1e1ea4c032a8fa8a09475a2ce09fe77a (patch)
tree79a1110d0f4a6f2d50d870fa77d11a5311fee4fc /drivers/edac/i5100_edac.c
parent5e2af0c09e60d11dd8297e259a9ca2b3d92d2cf4 (diff)
edac: move nr_pages to dimm struct
The number of pages is a dimm property. Move it to the dimm struct. After this change, it is possible to add sysfs nodes for the DIMM's that will properly represent the DIMM stick properties, including its size. A TODO fix here is to properly represent dual-rank/quad-rank DIMMs when the memory controller represents the memory via chip select rows. Reviewed-by: Aristeu Rozanski <arozansk@redhat.com> Acked-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Chris Metcalf <cmetcalf@tilera.com> Cc: Doug Thompson <norsk5@yahoo.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: "Niklas Söderlund" <niklas.soderlund@ericsson.com> Cc: Shaohui Xie <Shaohui.Xie@freescale.com> Cc: Josh Boyer <jwboyer@gmail.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.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c
index 5338c7968f78..c08e94064ef6 100644
--- a/drivers/edac/i5100_edac.c
+++ b/drivers/edac/i5100_edac.c
@@ -859,7 +859,6 @@ static void __devinit i5100_init_csrows(struct mem_ctl_info *mci)
859 * FIXME: these two are totally bogus -- I don't see how to 859 * FIXME: these two are totally bogus -- I don't see how to
860 * map them correctly to this structure... 860 * map them correctly to this structure...
861 */ 861 */
862 mci->csrows[i].nr_pages = npages;
863 mci->csrows[i].csrow_idx = i; 862 mci->csrows[i].csrow_idx = i;
864 mci->csrows[i].mci = mci; 863 mci->csrows[i].mci = mci;
865 mci->csrows[i].nr_channels = 1; 864 mci->csrows[i].nr_channels = 1;
@@ -867,14 +866,19 @@ static void __devinit i5100_init_csrows(struct mem_ctl_info *mci)
867 total_pages += npages; 866 total_pages += npages;
868 867
869 dimm = mci->csrows[i].channels[0].dimm; 868 dimm = mci->csrows[i].channels[0].dimm;
870 dimm->grain = 32; 869 dimm->nr_pages = npages;
871 dimm->dtype = (priv->mtr[chan][rank].width == 4) ? 870 if (npages) {
872 DEV_X4 : DEV_X8; 871 total_pages += npages;
873 dimm->mtype = MEM_RDDR2; 872
874 dimm->edac_mode = EDAC_SECDED; 873 dimm->grain = 32;
875 snprintf(dimm->label, sizeof(dimm->label), 874 dimm->dtype = (priv->mtr[chan][rank].width == 4) ?
876 "DIMM%u", 875 DEV_X4 : DEV_X8;
877 i5100_rank_to_slot(mci, chan, rank)); 876 dimm->mtype = MEM_RDDR2;
877 dimm->edac_mode = EDAC_SECDED;
878 snprintf(dimm->label, sizeof(dimm->label),
879 "DIMM%u",
880 i5100_rank_to_slot(mci, chan, rank));
881 }
878 } 882 }
879} 883}
880 884