lkml.org 
[lkml]   [2012]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 30/31] edac: Fix new error counts
Date
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/edac/edac_mc.c | 6 +-----
drivers/edac/edac_mc_sysfs.c | 9 ++++++---
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 3f74ba9..6714b36 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -249,12 +249,8 @@ struct mem_ctl_info *edac_mc_alloc(unsigned edac_index,
count *= layers[i].size;
ce_per_layer[i] = edac_align_ptr(&ptr, sizeof(unsigned), count);
ue_per_layer[i] = edac_align_ptr(&ptr, sizeof(unsigned), count);
- if (i < n_layers - 1)
- tot_errcount += 2 * count;
+ tot_errcount += 2 * count;
}
- /*
- * The last error count is equal to DIMM. So, don't export it twice
- */
erc = edac_align_ptr(&ptr, sizeof(*erc), tot_errcount);
ercd = edac_align_ptr(&ptr, sizeof(*ercd), tot_errcount);
pvt = edac_align_ptr(&ptr, sz_pvt, 1);
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index f8132ff..1d4ee32 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -866,7 +866,7 @@ static ssize_t errcount_ce_show(struct mem_ctl_info *mci, char *data,
struct errcount_attribute_data *ead = priv;
int i, index = 0;

- for (i = 0; i < mci->n_layers - 1; i++) {
+ for (i = 0; i < ead->n_layers - 1; i++) {
index += ead->pos[i];
index *= mci->layers[i].size;
}
@@ -881,7 +881,8 @@ static ssize_t errcount_ue_show(struct mem_ctl_info *mci, char *data,
struct errcount_attribute_data *ead = priv;
int i, index = 0;

- for (i = 0; i < mci->n_layers - 1; i++) {
+
+ for (i = 0; i < ead->n_layers - 1; i++) {
index += ead->pos[i];
index *= mci->layers[i].size;
}
@@ -921,6 +922,8 @@ static int edac_create_errcount_layer(struct mem_ctl_info *mci,
printk(KERN_ERR "sysfs_create_file failed: %d\n", err);
return err;
}
+ (*erc)++;
+ (*ercd)++;

(*erc)->attr.name = kasprintf(GFP_KERNEL, "ue%s", location);
debugf4("%s() creating %s\n", __func__, (*erc)->attr.name);
@@ -972,7 +975,7 @@ static int edac_create_errcount_objects(struct mem_ctl_info *mci)
int err, i, count;

count = 1;
- for (i = 0; i < mci->n_layers - 1; i++) {
+ for (i = 0; i < mci->n_layers; i++) {
count *= mci->layers[i].size;
err = edac_create_errcount_layer(mci, &erc, &ercd, i, count);
if (err < 0)
--
1.7.8


\
 
 \ /
  Last update: 2012-02-10 01:05    [from the cache]
©2003-2011 Jasper Spaans