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>
This commit is contained in:

committed by
Borislav Petkov

parent
921a689965
commit
16a528ee39
@@ -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));
|
||||
|
Reference in New Issue
Block a user