Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309130
b: refs/heads/master
c: 5926ff5
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed May 28, 2012
1 parent 729009f commit f8f959f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca0907b9e413bb1d1f3ea123b663535b74928846
refs/heads/master: 5926ff502f6b93ca0c1654f8a5c5317ea236dbdb
28 changes: 22 additions & 6 deletions trunk/drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
struct dimm_info *dimm;
u32 *ce_per_layer[EDAC_MAX_LAYERS], *ue_per_layer[EDAC_MAX_LAYERS];
unsigned pos[EDAC_MAX_LAYERS];
void *pvt, *ptr = NULL;
unsigned size, tot_dimms = 1, count = 1;
unsigned tot_csrows = 1, tot_channels = 1, tot_errcount = 0;
int i, j, err, row, chn;
void *pvt, *p, *ptr = NULL;
int i, j, err, row, chn, n, len;
bool per_rank = false;

BUG_ON(n_layers > EDAC_MAX_LAYERS || n_layers == 0);
Expand Down Expand Up @@ -325,10 +325,26 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
i, per_rank ? "rank" : "dimm", (dimm - mci->dimms),
pos[0], pos[1], pos[2], row, chn);

/* Copy DIMM location */
for (j = 0; j < n_layers; j++)
/*
* Copy DIMM location and initialize it.
*/
len = sizeof(dimm->label);
p = dimm->label;
n = snprintf(p, len, "mc#%u", mc_num);
p += n;
len -= n;
for (j = 0; j < n_layers; j++) {
n = snprintf(p, len, "%s#%u",
edac_layer_name[layers[j].type],
pos[j]);
p += n;
len -= n;
dimm->location[j] = pos[j];

if (len <= 0)
break;
}

/* Link it to the csrows old API data */
chan->dimm = dimm;
dimm->csrow = row;
Expand Down Expand Up @@ -834,7 +850,7 @@ static void edac_inc_ce_error(struct mem_ctl_info *mci,
{
int i, index = 0;

mci->ce_count++;
mci->ce_mc++;

if (!enable_per_layer_report) {
mci->ce_noinfo_count++;
Expand All @@ -858,7 +874,7 @@ static void edac_inc_ue_error(struct mem_ctl_info *mci,
{
int i, index = 0;

mci->ue_count++;
mci->ue_mc++;

if (!enable_per_layer_report) {
mci->ce_noinfo_count++;
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci,

mci->ue_noinfo_count = 0;
mci->ce_noinfo_count = 0;
mci->ue_count = 0;
mci->ce_count = 0;
mci->ue_mc = 0;
mci->ce_mc = 0;

for (row = 0; row < mci->nr_csrows; row++) {
struct csrow_info *ri = &mci->csrows[row];
Expand Down Expand Up @@ -495,12 +495,12 @@ static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data)
/* default attribute files for the MCI object */
static ssize_t mci_ue_count_show(struct mem_ctl_info *mci, char *data)
{
return sprintf(data, "%d\n", mci->ue_count);
return sprintf(data, "%d\n", mci->ue_mc);
}

static ssize_t mci_ce_count_show(struct mem_ctl_info *mci, char *data)
{
return sprintf(data, "%d\n", mci->ce_count);
return sprintf(data, "%d\n", mci->ce_mc);
}

static ssize_t mci_ce_noinfo_show(struct mem_ctl_info *mci, char *data)
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/edac.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ struct mem_ctl_info {
* already handles that.
*/
u32 ce_noinfo_count, ue_noinfo_count;
u32 ue_count, ce_count;
u32 ue_mc, ce_mc;
u32 *ce_per_layer[EDAC_MAX_LAYERS], *ue_per_layer[EDAC_MAX_LAYERS];

struct completion complete;
Expand Down

0 comments on commit f8f959f

Please sign in to comment.