From 11652769179296062c74233e168399a87a3f6e8a Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Thu, 13 Sep 2012 17:19:40 +0200 Subject: EDAC: Add memory controller flags The first flag is ->csbased and will be used in common EDAC code later. Signed-off-by: Borislav Petkov --- include/linux/edac.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/edac.h b/include/linux/edac.h index bab9f8473dc1..07bda01bf20a 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h @@ -667,6 +667,8 @@ struct mem_ctl_info { u32 fake_inject_ue; u16 fake_inject_count; #endif + __u8 csbased : 1, /* csrow-based memory controller */ + __resv : 7; }; #endif -- cgit v1.2.3-55-g7522 From 16a528ee3975c860dc93fbfc718fe9aa25ed92bc Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Thu, 13 Sep 2012 18:53:58 +0200 Subject: 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 --- drivers/edac/amd64_edac.c | 1 + drivers/edac/edac_mc_sysfs.c | 3 +++ include/linux/edac.h | 1 + 3 files changed, 5 insertions(+) (limited to 'include') diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 307ff66266a0..f74a684269ff 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -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; diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index cf13bff94f5c..bd46610979c7 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)); diff --git a/include/linux/edac.h b/include/linux/edac.h index 07bda01bf20a..1b8c02b36f76 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h @@ -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 */ -- cgit v1.2.3-55-g7522