diff options
author | Josh Hunt <johunt@akamai.com> | 2012-09-21 10:45:49 -0400 |
---|---|---|
committer | Borislav Petkov <bp@alien8.de> | 2012-11-28 05:54:50 -0500 |
commit | 3c0622760aaa4731e2fd3a7472a96b59d2caecc4 (patch) | |
tree | b2508be35c84f0501189969c995fdab433edcb4f /drivers/edac | |
parent | 16a528ee3975c860dc93fbfc718fe9aa25ed92bc (diff) |
EDAC: Fix mc size reported in sysfs
This is the complement to previous commit "EDAC: Fix csrow size
reported in sysfs". This fixes the memory controller size reporting on
csrow-based memory controllers. The csrow size is already combined for
both channels. Without this patch memory size is reported doubled.
Signed-off-by: Josh Hunt <johunt@akamai.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index bd46610979c7..a242dae1aeb0 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -781,10 +781,14 @@ static ssize_t mci_size_mb_show(struct device *dev, | |||
781 | for (csrow_idx = 0; csrow_idx < mci->nr_csrows; csrow_idx++) { | 781 | for (csrow_idx = 0; csrow_idx < mci->nr_csrows; csrow_idx++) { |
782 | struct csrow_info *csrow = mci->csrows[csrow_idx]; | 782 | struct csrow_info *csrow = mci->csrows[csrow_idx]; |
783 | 783 | ||
784 | for (j = 0; j < csrow->nr_channels; j++) { | 784 | if (csrow->mci->csbased) { |
785 | struct dimm_info *dimm = csrow->channels[j]->dimm; | 785 | total_pages += csrow->nr_pages; |
786 | 786 | } else { | |
787 | total_pages += dimm->nr_pages; | 787 | for (j = 0; j < csrow->nr_channels; j++) { |
788 | struct dimm_info *dimm = csrow->channels[j]->dimm; | ||
789 | |||
790 | total_pages += dimm->nr_pages; | ||
791 | } | ||
788 | } | 792 | } |
789 | } | 793 | } |
790 | 794 | ||