aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-04-26 10:47:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-28 18:13:55 -0400
commit0bf09e829dd4b07227ed5a8bc4ac85752a044458 (patch)
tree7ae3bb65515c81f503536857265aa905c47cc14b /drivers
parent486dfb1638bc49e9f3bbbefbe4832024ba6abe0d (diff)
i7core: fix ranks information at the per-channel struct
There is a flag at the per-channel struct that indicates if there are any 4R dimm on it. The way the presence of this flag were reported is not ok, as it might give the false idea that the channel were filled with 2R memories: [ 580.588701] EDAC DEBUG: get_dimm_config: Ch1 phy rd1, wr1 (0x063f7431): 2 ranks, UDIMMs [ 580.588704] EDAC DEBUG: get_dimm_config: dimm 0 1024 Mb offset: 0, bank: 8, rank: 1, row: 0x4000, col: 0x400 (in this case, just one 1R memory is filled on channel 1) So, use a better way to represent the per-channel ranks information. After the patch, it will show: [ 2002.233978] EDAC DEBUG: get_dimm_config: Ch0 phy rd0, wr0 (0x063f7431): UDIMMs [ 2002.233982] EDAC DEBUG: get_dimm_config: dimm 0 1024 Mb offset: 0, bank: 8, rank: 1, row: 0x4000, col: 0x400 [ 2002.233988] EDAC DEBUG: get_dimm_config: dimm 1 1024 Mb offset: 4, bank: 8, rank: 1, row: 0x4000, col: 0x400 (in this case, there isn't any 4R memories) Reported-by: Borislav Petkov <borislav.petkov@amd.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/edac/i7core_edac.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 2aacd951d41c..c05e1ada7a3d 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -221,7 +221,9 @@ struct i7core_inject {
221}; 221};
222 222
223struct i7core_channel { 223struct i7core_channel {
224 u32 ranks; 224 bool is_3dimms_present;
225 bool is_single_4rank;
226 bool has_4rank;
225 u32 dimms; 227 u32 dimms;
226}; 228};
227 229
@@ -555,21 +557,20 @@ static int get_dimm_config(struct mem_ctl_info *mci)
555 pci_read_config_dword(pvt->pci_ch[i][0], 557 pci_read_config_dword(pvt->pci_ch[i][0],
556 MC_CHANNEL_DIMM_INIT_PARAMS, &data); 558 MC_CHANNEL_DIMM_INIT_PARAMS, &data);
557 559
558 pvt->channel[i].ranks = (data & QUAD_RANK_PRESENT) ? 560
559 4 : 2; 561 if (data & THREE_DIMMS_PRESENT)
562 pvt->channel[i].is_3dimms_present = true;
563
564 if (data & SINGLE_QUAD_RANK_PRESENT)
565 pvt->channel[i].is_single_4rank = true;
566
567 if (data & QUAD_RANK_PRESENT)
568 pvt->channel[i].has_4rank = true;
560 569
561 if (data & REGISTERED_DIMM) 570 if (data & REGISTERED_DIMM)
562 mtype = MEM_RDDR3; 571 mtype = MEM_RDDR3;
563 else 572 else
564 mtype = MEM_DDR3; 573 mtype = MEM_DDR3;
565#if 0
566 if (data & THREE_DIMMS_PRESENT)
567 pvt->channel[i].dimms = 3;
568 else if (data & SINGLE_QUAD_RANK_PRESENT)
569 pvt->channel[i].dimms = 1;
570 else
571 pvt->channel[i].dimms = 2;
572#endif
573 574
574 /* Devices 4-6 function 1 */ 575 /* Devices 4-6 function 1 */
575 pci_read_config_dword(pvt->pci_ch[i][1], 576 pci_read_config_dword(pvt->pci_ch[i][1],
@@ -580,11 +581,13 @@ static int get_dimm_config(struct mem_ctl_info *mci)
580 MC_DOD_CH_DIMM2, &dimm_dod[2]); 581 MC_DOD_CH_DIMM2, &dimm_dod[2]);
581 582
582 debugf0("Ch%d phy rd%d, wr%d (0x%08x): " 583 debugf0("Ch%d phy rd%d, wr%d (0x%08x): "
583 "%d ranks, %cDIMMs\n", 584 "%s%s%s%cDIMMs\n",
584 i, 585 i,
585 RDLCH(pvt->info.ch_map, i), WRLCH(pvt->info.ch_map, i), 586 RDLCH(pvt->info.ch_map, i), WRLCH(pvt->info.ch_map, i),
586 data, 587 data,
587 pvt->channel[i].ranks, 588 pvt->channel[i].is_3dimms_present ? "3DIMMS " : "",
589 pvt->channel[i].is_3dimms_present ? "SINGLE_4R " : "",
590 pvt->channel[i].has_4rank ? "HAS_4R " : "",
588 (data & REGISTERED_DIMM) ? 'R' : 'U'); 591 (data & REGISTERED_DIMM) ? 'R' : 'U');
589 592
590 for (j = 0; j < 3; j++) { 593 for (j = 0; j < 3; j++) {