Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c062276 authored by Josh Hunt's avatar Josh Hunt Committed by Borislav Petkov
Browse files

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: default avatarJosh Hunt <johunt@akamai.com>
Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
parent 16a528ee
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -781,12 +781,16 @@ static ssize_t mci_size_mb_show(struct device *dev,
	for (csrow_idx = 0; csrow_idx < mci->nr_csrows; csrow_idx++) {
		struct csrow_info *csrow = mci->csrows[csrow_idx];

		if (csrow->mci->csbased) {
			total_pages += csrow->nr_pages;
		} else {
			for (j = 0; j < csrow->nr_channels; j++) {
				struct dimm_info *dimm = csrow->channels[j]->dimm;

				total_pages += dimm->nr_pages;
			}
		}
	}

	return sprintf(data, "%u\n", PAGES_TO_MiB(total_pages));
}