diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2012-09-13 12:53:58 -0400 |
---|---|---|
committer | Borislav Petkov <bp@alien8.de> | 2012-11-28 05:54:40 -0500 |
commit | 16a528ee3975c860dc93fbfc718fe9aa25ed92bc (patch) | |
tree | ea0d20d3544df6dfe2977634d1a4cc837f80b964 /drivers/edac | |
parent | 921a689965c26ae6fde12ebaadb4183cbfdb01fb (diff) |
EDAC: Fix csrow size reported in sysfs
On csrow-based memory controllers, we combine the csrow size from both
channels and there's no need to do that again in csrow_size_show which
leads to double the size of a csrow.
Fix it.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/amd64_edac.c | 1 | ||||
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 307ff66266a0..f74a684269ff 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -2174,6 +2174,7 @@ static int init_csrows(struct mem_ctl_info *mci) | |||
2174 | dimm->edac_mode = edac_mode; | 2174 | dimm->edac_mode = edac_mode; |
2175 | dimm->nr_pages = nr_pages; | 2175 | dimm->nr_pages = nr_pages; |
2176 | } | 2176 | } |
2177 | csrow->nr_pages = nr_pages; | ||
2177 | } | 2178 | } |
2178 | 2179 | ||
2179 | return empty; | 2180 | return empty; |
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index cf13bff94f5c..bd46610979c7 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -180,6 +180,9 @@ static ssize_t csrow_size_show(struct device *dev, | |||
180 | int i; | 180 | int i; |
181 | u32 nr_pages = 0; | 181 | u32 nr_pages = 0; |
182 | 182 | ||
183 | if (csrow->mci->csbased) | ||
184 | return sprintf(data, "%u\n", PAGES_TO_MiB(csrow->nr_pages)); | ||
185 | |||
183 | for (i = 0; i < csrow->nr_channels; i++) | 186 | for (i = 0; i < csrow->nr_channels; i++) |
184 | nr_pages += csrow->channels[i]->dimm->nr_pages; | 187 | nr_pages += csrow->channels[i]->dimm->nr_pages; |
185 | return sprintf(data, "%u\n", PAGES_TO_MiB(nr_pages)); | 188 | return sprintf(data, "%u\n", PAGES_TO_MiB(nr_pages)); |