diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2012-09-13 16:53:58 (GMT) |
---|---|---|
committer | Borislav Petkov <bp@alien8.de> | 2012-11-28 10:54:40 (GMT) |
commit | 16a528ee3975c860dc93fbfc718fe9aa25ed92bc (patch) | |
tree | ea0d20d3544df6dfe2977634d1a4cc837f80b964 /drivers/edac/edac_mc_sysfs.c | |
parent | 921a689965c26ae6fde12ebaadb4183cbfdb01fb (diff) | |
download | linux-16a528ee3975c860dc93fbfc718fe9aa25ed92bc.tar.xz |
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/edac_mc_sysfs.c')
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index cf13bff..bd46610 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, int i; u32 nr_pages = 0; + if (csrow->mci->csbased) + return sprintf(data, "%u\n", PAGES_TO_MiB(csrow->nr_pages)); + for (i = 0; i < csrow->nr_channels; i++) nr_pages += csrow->channels[i]->dimm->nr_pages; return sprintf(data, "%u\n", PAGES_TO_MiB(nr_pages)); |