aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-11 08:28:48 -0400
committerBorislav Petkov <bp@suse.de>2013-03-16 01:32:30 -0400
commit9713faecff3d071de1208b081d4943b002e9cb1c (patch)
treeb6ab68f15527eae952a407aa604607aca719a5ba
parent1eef1282549d7accdd33ee36d409b039b1f911fb (diff)
EDAC: Merge mci.mem_is_per_rank with mci.csbased
Both mci.mem_is_per_rank and mci.csbased denote the same thing: the memory controller is csrows based. Merge both fields into one. There's no need for the driver to actually fill it, as the core detects it by checking if one of the layers has the csrows type as part of the memory hierarchy: if (layers[i].type == EDAC_MC_LAYER_CHIP_SELECT) per_rank = true; Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--drivers/edac/amd64_edac.c1
-rw-r--r--drivers/edac/edac_mc.c6
-rw-r--r--drivers/edac/edac_mc_sysfs.c2
-rw-r--r--include/linux/edac.h6
4 files changed, 6 insertions, 9 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 532de775a184..e1d13c463c90 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2423,7 +2423,6 @@ static int amd64_init_one_instance(struct pci_dev *F2)
2423 2423
2424 mci->pvt_info = pvt; 2424 mci->pvt_info = pvt;
2425 mci->pdev = &pvt->F2->dev; 2425 mci->pdev = &pvt->F2->dev;
2426 mci->csbased = 1;
2427 2426
2428 setup_mci_misc_attrs(mci, fam_type); 2427 setup_mci_misc_attrs(mci, fam_type);
2429 2428
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index cdb81aa73ab7..27e86d938262 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -86,7 +86,7 @@ static void edac_mc_dump_dimm(struct dimm_info *dimm, int number)
86 edac_dimm_info_location(dimm, location, sizeof(location)); 86 edac_dimm_info_location(dimm, location, sizeof(location));
87 87
88 edac_dbg(4, "%s%i: %smapped as virtual row %d, chan %d\n", 88 edac_dbg(4, "%s%i: %smapped as virtual row %d, chan %d\n",
89 dimm->mci->mem_is_per_rank ? "rank" : "dimm", 89 dimm->mci->csbased ? "rank" : "dimm",
90 number, location, dimm->csrow, dimm->cschannel); 90 number, location, dimm->csrow, dimm->cschannel);
91 edac_dbg(4, " dimm = %p\n", dimm); 91 edac_dbg(4, " dimm = %p\n", dimm);
92 edac_dbg(4, " dimm->label = '%s'\n", dimm->label); 92 edac_dbg(4, " dimm->label = '%s'\n", dimm->label);
@@ -341,7 +341,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
341 memcpy(mci->layers, layers, sizeof(*layer) * n_layers); 341 memcpy(mci->layers, layers, sizeof(*layer) * n_layers);
342 mci->nr_csrows = tot_csrows; 342 mci->nr_csrows = tot_csrows;
343 mci->num_cschannel = tot_channels; 343 mci->num_cschannel = tot_channels;
344 mci->mem_is_per_rank = per_rank; 344 mci->csbased = per_rank;
345 345
346 /* 346 /*
347 * Alocate and fill the csrow/channels structs 347 * Alocate and fill the csrow/channels structs
@@ -1235,7 +1235,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
1235 * incrementing the compat API counters 1235 * incrementing the compat API counters
1236 */ 1236 */
1237 edac_dbg(4, "%s csrows map: (%d,%d)\n", 1237 edac_dbg(4, "%s csrows map: (%d,%d)\n",
1238 mci->mem_is_per_rank ? "rank" : "dimm", 1238 mci->csbased ? "rank" : "dimm",
1239 dimm->csrow, dimm->cschannel); 1239 dimm->csrow, dimm->cschannel);
1240 if (row == -1) 1240 if (row == -1)
1241 row = dimm->csrow; 1241 row = dimm->csrow;
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 4c50a4760db7..5899a76eec3b 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -609,7 +609,7 @@ static int edac_create_dimm_object(struct mem_ctl_info *mci,
609 device_initialize(&dimm->dev); 609 device_initialize(&dimm->dev);
610 610
611 dimm->dev.parent = &mci->dev; 611 dimm->dev.parent = &mci->dev;
612 if (mci->mem_is_per_rank) 612 if (mci->csbased)
613 dev_set_name(&dimm->dev, "rank%d", index); 613 dev_set_name(&dimm->dev, "rank%d", index);
614 else 614 else
615 dev_set_name(&dimm->dev, "dimm%d", index); 615 dev_set_name(&dimm->dev, "dimm%d", index);
diff --git a/include/linux/edac.h b/include/linux/edac.h
index ab1ea98e767c..0b763276f619 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -675,11 +675,11 @@ struct mem_ctl_info {
675 * sees memory sticks ("dimms"), and the ones that sees memory ranks. 675 * sees memory sticks ("dimms"), and the ones that sees memory ranks.
676 * All old memory controllers enumerate memories per rank, but most 676 * All old memory controllers enumerate memories per rank, but most
677 * of the recent drivers enumerate memories per DIMM, instead. 677 * of the recent drivers enumerate memories per DIMM, instead.
678 * When the memory controller is per rank, mem_is_per_rank is true. 678 * When the memory controller is per rank, csbased is true.
679 */ 679 */
680 unsigned n_layers; 680 unsigned n_layers;
681 struct edac_mc_layer *layers; 681 struct edac_mc_layer *layers;
682 bool mem_is_per_rank; 682 bool csbased;
683 683
684 /* 684 /*
685 * DIMM info. Will eventually remove the entire csrows_info some day 685 * DIMM info. Will eventually remove the entire csrows_info some day
@@ -740,8 +740,6 @@ struct mem_ctl_info {
740 u32 fake_inject_ue; 740 u32 fake_inject_ue;
741 u16 fake_inject_count; 741 u16 fake_inject_count;
742#endif 742#endif
743 __u8 csbased : 1, /* csrow-based memory controller */
744 __resv : 7;
745}; 743};
746 744
747#endif 745#endif