aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/amd64_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/amd64_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/amd64_edac.c')
-rw-r--r--drivers/edac/amd64_edac.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index e2c5a94f683c..1ceb8e276376 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2152,7 +2152,7 @@ static u32 amd64_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr)
2152 nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode) << (20 - PAGE_SHIFT); 2152 nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode) << (20 - PAGE_SHIFT);
2153 2153
2154 debugf0(" (csrow=%d) DBAM map index= %d\n", csrow_nr, cs_mode); 2154 debugf0(" (csrow=%d) DBAM map index= %d\n", csrow_nr, cs_mode);
2155 debugf0(" nr_pages= %u channel-count = %d\n", 2155 debugf0(" nr_pages/channel= %u channel-count = %d\n",
2156 nr_pages, pvt->channel_count); 2156 nr_pages, pvt->channel_count);
2157 2157
2158 return nr_pages; 2158 return nr_pages;
@@ -2171,6 +2171,7 @@ static int init_csrows(struct mem_ctl_info *mci)
2171 int i, j, empty = 1; 2171 int i, j, empty = 1;
2172 enum mem_type mtype; 2172 enum mem_type mtype;
2173 enum edac_type edac_mode; 2173 enum edac_type edac_mode;
2174 int nr_pages = 0;
2174 2175
2175 amd64_read_pci_cfg(pvt->F3, NBCFG, &val); 2176 amd64_read_pci_cfg(pvt->F3, NBCFG, &val);
2176 2177
@@ -2194,9 +2195,9 @@ static int init_csrows(struct mem_ctl_info *mci)
2194 2195
2195 empty = 0; 2196 empty = 0;
2196 if (csrow_enabled(i, 0, pvt)) 2197 if (csrow_enabled(i, 0, pvt))
2197 csrow->nr_pages = amd64_csrow_nr_pages(pvt, 0, i); 2198 nr_pages = amd64_csrow_nr_pages(pvt, 0, i);
2198 if (csrow_enabled(i, 1, pvt)) 2199 if (csrow_enabled(i, 1, pvt))
2199 csrow->nr_pages += amd64_csrow_nr_pages(pvt, 1, i); 2200 nr_pages += amd64_csrow_nr_pages(pvt, 1, i);
2200 2201
2201 get_cs_base_and_mask(pvt, i, 0, &base, &mask); 2202 get_cs_base_and_mask(pvt, i, 0, &base, &mask);
2202 /* 8 bytes of resolution */ 2203 /* 8 bytes of resolution */
@@ -2204,7 +2205,7 @@ static int init_csrows(struct mem_ctl_info *mci)
2204 mtype = amd64_determine_memory_type(pvt, i); 2205 mtype = amd64_determine_memory_type(pvt, i);
2205 2206
2206 debugf1(" for MC node %d csrow %d:\n", pvt->mc_node_id, i); 2207 debugf1(" for MC node %d csrow %d:\n", pvt->mc_node_id, i);
2207 debugf1(" nr_pages: %u\n", csrow->nr_pages); 2208 debugf1(" nr_pages: %u\n", nr_pages * pvt->channel_count);
2208 2209
2209 /* 2210 /*
2210 * determine whether CHIPKILL or JUST ECC or NO ECC is operating 2211 * determine whether CHIPKILL or JUST ECC or NO ECC is operating
@@ -2218,6 +2219,7 @@ static int init_csrows(struct mem_ctl_info *mci)
2218 for (j = 0; j < pvt->channel_count; j++) { 2219 for (j = 0; j < pvt->channel_count; j++) {
2219 csrow->channels[j].dimm->mtype = mtype; 2220 csrow->channels[j].dimm->mtype = mtype;
2220 csrow->channels[j].dimm->edac_mode = edac_mode; 2221 csrow->channels[j].dimm->edac_mode = edac_mode;
2222 csrow->channels[j].dimm->nr_pages = nr_pages;
2221 } 2223 }
2222 } 2224 }
2223 2225