@@ -3357,7 +3357,7 @@ static u32 get_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr_orig)
return nr_pages;
}
-static int init_csrows_df(struct mem_ctl_info *mci)
+static int umc_init_csrows(struct mem_ctl_info *mci)
{
struct amd64_pvt *pvt = mci->pvt_info;
enum edac_type edac_mode = EDAC_NONE;
@@ -3405,7 +3405,7 @@ static int init_csrows_df(struct mem_ctl_info *mci)
* Initialize the array of csrow attribute instances, based on the values
* from pci config hardware registers.
*/
-static int init_csrows(struct mem_ctl_info *mci)
+static int dct_init_csrows(struct mem_ctl_info *mci)
{
struct amd64_pvt *pvt = mci->pvt_info;
enum edac_type edac_mode = EDAC_NONE;
@@ -3415,9 +3415,6 @@ static int init_csrows(struct mem_ctl_info *mci)
int nr_pages = 0;
u32 val;
- if (pvt->umc)
- return init_csrows_df(mci);
-
amd64_read_pci_cfg(pvt->F3, NBCFG, &val);
pvt->nbcfg = val;
@@ -3768,6 +3765,7 @@ static struct low_ops umc_ops = {
.ecc_enabled = umc_ecc_enabled,
.determine_edac_cap = umc_determine_edac_cap,
.determine_edac_ctl_cap = umc_determine_edac_ctl_cap,
+ .init_csrows = umc_init_csrows,
.setup_mci_misc_attrs = setup_mci_misc_attrs,
};
@@ -3784,6 +3782,7 @@ static struct low_ops dct_ops = {
.ecc_enabled = dct_ecc_enabled,
.determine_edac_cap = dct_determine_edac_cap,
.determine_edac_ctl_cap = dct_determine_edac_ctl_cap,
+ .init_csrows = dct_init_csrows,
.setup_mci_misc_attrs = setup_mci_misc_attrs,
};
@@ -4005,7 +4004,7 @@ static int init_one_instance(struct amd64_pvt *pvt)
pvt->ops->setup_mci_misc_attrs(mci);
- if (init_csrows(mci))
+ if (pvt->ops->init_csrows(mci))
mci->edac_cap = EDAC_FLAG_NONE;
ret = -ENODEV;
@@ -477,6 +477,7 @@ struct low_ops {
unsigned long (*determine_edac_cap)(struct amd64_pvt *pvt);
void (*determine_edac_ctl_cap)(struct mem_ctl_info *mci, struct amd64_pvt *pvt);
void (*setup_mci_misc_attrs)(struct mem_ctl_info *mci);
+ int (*init_csrows)(struct mem_ctl_info *mci);
};
int __amd64_read_pci_cfg_dword(struct pci_dev *pdev, int offset,