Skip to content

Commit 78ec161

Browse files
muralimk-amdbp3tk0v
authored andcommitted
EDAC/amd64: Split determine_memory_type() into dct/umc functions
Call them from their respective hw_info_get() paths. Call them after all other hardware registers have been saved, since the memory type for a device will be determined based on the saved information. [ Yazen: rebased/reworked patch and reworded commit message. ] Signed-off-by: Muralidhara M K <muralidhara.mk@amd.com> Co-developed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Signed-off-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com> Co-developed-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20230127170419.1824692-15-yazen.ghannam@amd.com
1 parent b29dad9 commit 78ec161

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

drivers/edac/amd64_edac.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ static void dct_read_base_mask(struct amd64_pvt *pvt)
17351735
}
17361736
}
17371737

1738-
static void determine_memory_type_df(struct amd64_pvt *pvt)
1738+
static void umc_determine_memory_type(struct amd64_pvt *pvt)
17391739
{
17401740
struct amd64_umc *umc;
17411741
u32 i;
@@ -1772,13 +1772,10 @@ static void determine_memory_type_df(struct amd64_pvt *pvt)
17721772
}
17731773
}
17741774

1775-
static void determine_memory_type(struct amd64_pvt *pvt)
1775+
static void dct_determine_memory_type(struct amd64_pvt *pvt)
17761776
{
17771777
u32 dram_ctrl, dcsm;
17781778

1779-
if (pvt->umc)
1780-
return determine_memory_type_df(pvt);
1781-
17821779
switch (pvt->fam) {
17831780
case 0xf:
17841781
if (pvt->ext_model >= K8_REV_F)
@@ -1828,6 +1825,8 @@ static void determine_memory_type(struct amd64_pvt *pvt)
18281825
WARN(1, KERN_ERR "%s: Family??? 0x%x\n", __func__, pvt->fam);
18291826
pvt->dram_type = MEM_EMPTY;
18301827
}
1828+
1829+
edac_dbg(1, " DIMM type: %s\n", edac_mem_types[pvt->dram_type]);
18311830
return;
18321831

18331832
ddr3:
@@ -3183,10 +3182,6 @@ static void read_mc_regs(struct amd64_pvt *pvt)
31833182

31843183
skip:
31853184

3186-
determine_memory_type(pvt);
3187-
3188-
if (!pvt->umc)
3189-
edac_dbg(1, " DIMM type: %s\n", edac_mem_types[pvt->dram_type]);
31903185

31913186
determine_ecc_sym_sz(pvt);
31923187
}
@@ -3664,6 +3659,7 @@ static int dct_hw_info_get(struct amd64_pvt *pvt)
36643659
dct_prep_chip_selects(pvt);
36653660
dct_read_base_mask(pvt);
36663661
read_mc_regs(pvt);
3662+
dct_determine_memory_type(pvt);
36673663

36683664
return 0;
36693665
}
@@ -3677,6 +3673,7 @@ static int umc_hw_info_get(struct amd64_pvt *pvt)
36773673
umc_prep_chip_selects(pvt);
36783674
umc_read_base_mask(pvt);
36793675
read_mc_regs(pvt);
3676+
umc_determine_memory_type(pvt);
36803677

36813678
return 0;
36823679
}

0 commit comments

Comments
 (0)