Skip to content

Commit f6f3638

Browse files
muralimk-amdbp3tk0v
authored andcommitted
EDAC/amd64: Split dump_misc_regs() into dct/umc functions
Add a function pointer to pvt->ops. No functional change is intended. [ 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-22-yazen.ghannam@amd.com
1 parent 6fb8b5f commit f6f3638

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

drivers/edac/amd64_edac.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ static void umc_debug_display_dimm_sizes(struct amd64_pvt *pvt, u8 ctrl)
15251525
}
15261526
}
15271527

1528-
static void __dump_misc_regs_df(struct amd64_pvt *pvt)
1528+
static void umc_dump_misc_regs(struct amd64_pvt *pvt)
15291529
{
15301530
struct amd64_umc *umc;
15311531
u32 i, tmp, umc_base;
@@ -1568,8 +1568,7 @@ static void __dump_misc_regs_df(struct amd64_pvt *pvt)
15681568
}
15691569
}
15701570

1571-
/* Display and decode various NB registers for debug purposes. */
1572-
static void __dump_misc_regs(struct amd64_pvt *pvt)
1571+
static void dct_dump_misc_regs(struct amd64_pvt *pvt)
15731572
{
15741573
edac_dbg(1, "F3xE8 (NB Cap): 0x%08x\n", pvt->nbcap);
15751574

@@ -1606,15 +1605,6 @@ static void __dump_misc_regs(struct amd64_pvt *pvt)
16061605
amd64_info("using x%u syndromes.\n", pvt->ecc_sym_sz);
16071606
}
16081607

1609-
/* Display and decode various NB registers for debug purposes. */
1610-
static void dump_misc_regs(struct amd64_pvt *pvt)
1611-
{
1612-
if (pvt->umc)
1613-
__dump_misc_regs_df(pvt);
1614-
else
1615-
__dump_misc_regs(pvt);
1616-
}
1617-
16181608
/*
16191609
* See BKDG, F2x[1,0][5C:40], F2[1,0][6C:60]
16201610
*/
@@ -3694,6 +3684,7 @@ static struct low_ops umc_ops = {
36943684
.hw_info_get = umc_hw_info_get,
36953685
.ecc_enabled = umc_ecc_enabled,
36963686
.setup_mci_misc_attrs = umc_setup_mci_misc_attrs,
3687+
.dump_misc_regs = umc_dump_misc_regs,
36973688
};
36983689

36993690
/* Use Family 16h versions for defaults and adjust as needed below. */
@@ -3703,6 +3694,7 @@ static struct low_ops dct_ops = {
37033694
.hw_info_get = dct_hw_info_get,
37043695
.ecc_enabled = dct_ecc_enabled,
37053696
.setup_mci_misc_attrs = dct_setup_mci_misc_attrs,
3697+
.dump_misc_regs = dct_dump_misc_regs,
37063698
};
37073699

37083700
static int per_family_init(struct amd64_pvt *pvt)
@@ -3953,7 +3945,8 @@ static int probe_one_instance(unsigned int nid)
39533945

39543946
amd64_info("%s detected (node %d).\n", pvt->ctl_name, pvt->mc_node_id);
39553947

3956-
dump_misc_regs(pvt);
3948+
/* Display and decode various registers for debug purposes. */
3949+
pvt->ops->dump_misc_regs(pvt);
39573950

39583951
return ret;
39593952

drivers/edac/amd64_edac.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ struct low_ops {
469469
int (*hw_info_get)(struct amd64_pvt *pvt);
470470
bool (*ecc_enabled)(struct amd64_pvt *pvt);
471471
void (*setup_mci_misc_attrs)(struct mem_ctl_info *mci);
472+
void (*dump_misc_regs)(struct amd64_pvt *pvt);
472473
};
473474

474475
int __amd64_read_pci_cfg_dword(struct pci_dev *pdev, int offset,

0 commit comments

Comments
 (0)