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

Commit 16a528ee authored by Borislav Petkov's avatar Borislav Petkov Committed by Borislav Petkov
Browse files

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: default avatarBorislav Petkov <borislav.petkov@amd.com>
parent 921a6899
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2174,6 +2174,7 @@ static int init_csrows(struct mem_ctl_info *mci)
			dimm->edac_mode = edac_mode;
			dimm->nr_pages = nr_pages;
		}
		csrow->nr_pages = nr_pages;
	}

	return empty;
+3 −0
Original line number Diff line number Diff line
@@ -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));
+1 −0
Original line number Diff line number Diff line
@@ -533,6 +533,7 @@ struct csrow_info {

	u32 ue_count;		/* Uncorrectable Errors for this csrow */
	u32 ce_count;		/* Correctable Errors for this csrow */
	u32 nr_pages;		/* combined pages count of all channels */

	struct mem_ctl_info *mci;	/* the parent */