Commit 16a528ee3975c860dc93fbfc718fe9aa25ed92bc
Committed by
Borislav Petkov
1 parent
921a689965
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 3 changed files with 5 additions and 0 deletions Side-by-side Diff
drivers/edac/amd64_edac.c
drivers/edac/edac_mc_sysfs.c
... | ... | @@ -180,6 +180,9 @@ |
180 | 180 | int i; |
181 | 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 | 186 | for (i = 0; i < csrow->nr_channels; i++) |
184 | 187 | nr_pages += csrow->channels[i]->dimm->nr_pages; |
185 | 188 | return sprintf(data, "%u\n", PAGES_TO_MiB(nr_pages)); |
include/linux/edac.h