Commit f8851cb2 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'edac_updates_for_5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC updates from Tony Luck:
 "Boris is on vacation and aske me to send you the EDAC changes"

* tag 'edac_updates_for_5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC: Fix reference count leaks
  EDAC: Remove edac_get_dimm_by_index()
  EDAC/ghes: Scan the system once on driver init
  EDAC/ghes: Remove unused members of struct ghes_edac_pvt, rename it to ghes_pvt
  EDAC/ghes: Setup DIMM label from DMI and use it in error reports
  EDAC, {skx,i10nm}: Use CPU stepping macro to pass configurations
  EDAC/mc: Call edac_inc_ue_error() before panic
  EDAC, pnd2: Set MCE_PRIO_EDAC priority for pnd2_mce_dec notifier
parents d4db4e55 0f959e19
...@@ -275,6 +275,7 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev) ...@@ -275,6 +275,7 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev)
/* Error exit stack */ /* Error exit stack */
err_kobj_reg: err_kobj_reg:
kobject_put(&edac_dev->kobj);
module_put(edac_dev->owner); module_put(edac_dev->owner);
err_out: err_out:
......
...@@ -950,6 +950,8 @@ static void edac_ue_error(struct edac_raw_error_desc *e) ...@@ -950,6 +950,8 @@ static void edac_ue_error(struct edac_raw_error_desc *e)
e->other_detail); e->other_detail);
} }
edac_inc_ue_error(e);
if (edac_mc_get_panic_on_ue()) { if (edac_mc_get_panic_on_ue()) {
panic("UE %s%son %s (%s page:0x%lx offset:0x%lx grain:%ld%s%s)\n", panic("UE %s%son %s (%s page:0x%lx offset:0x%lx grain:%ld%s%s)\n",
e->msg, e->msg,
...@@ -959,8 +961,6 @@ static void edac_ue_error(struct edac_raw_error_desc *e) ...@@ -959,8 +961,6 @@ static void edac_ue_error(struct edac_raw_error_desc *e)
*e->other_detail ? " - " : "", *e->other_detail ? " - " : "",
e->other_detail); e->other_detail);
} }
edac_inc_ue_error(e);
} }
static void edac_inc_csrow(struct edac_raw_error_desc *e, int row, int chan) static void edac_inc_csrow(struct edac_raw_error_desc *e, int row, int chan)
......
...@@ -386,7 +386,7 @@ static int edac_pci_main_kobj_setup(void) ...@@ -386,7 +386,7 @@ static int edac_pci_main_kobj_setup(void)
/* Error unwind statck */ /* Error unwind statck */
kobject_init_and_add_fail: kobject_init_and_add_fail:
kfree(edac_pci_top_main_kobj); kobject_put(edac_pci_top_main_kobj);
kzalloc_fail: kzalloc_fail:
module_put(THIS_MODULE); module_put(THIS_MODULE);
......
This diff is collapsed.
...@@ -135,9 +135,11 @@ static struct res_config i10nm_cfg1 = { ...@@ -135,9 +135,11 @@ static struct res_config i10nm_cfg1 = {
}; };
static const struct x86_cpu_id i10nm_cpuids[] = { static const struct x86_cpu_id i10nm_cpuids[] = {
X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_D, &i10nm_cfg0), X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS(ATOM_TREMONT_D, X86_STEPPINGS(0x0, 0x3), &i10nm_cfg0),
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &i10nm_cfg0), X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS(ATOM_TREMONT_D, X86_STEPPINGS(0x4, 0xf), &i10nm_cfg1),
X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, &i10nm_cfg1), X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS(ICELAKE_X, X86_STEPPINGS(0x0, 0x3), &i10nm_cfg0),
X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS(ICELAKE_X, X86_STEPPINGS(0x4, 0xf), &i10nm_cfg1),
X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS(ICELAKE_D, X86_STEPPINGS(0x0, 0xf), &i10nm_cfg1),
{} {}
}; };
MODULE_DEVICE_TABLE(x86cpu, i10nm_cpuids); MODULE_DEVICE_TABLE(x86cpu, i10nm_cpuids);
...@@ -264,10 +266,6 @@ static int __init i10nm_init(void) ...@@ -264,10 +266,6 @@ static int __init i10nm_init(void)
cfg = (struct res_config *)id->driver_data; cfg = (struct res_config *)id->driver_data;
/* Newer steppings have different offset for ATOM_TREMONT_D/ICELAKE_X */
if (boot_cpu_data.x86_stepping >= 4)
cfg->busno_cfg_offset = 0xd0;
rc = skx_get_hi_lo(0x09a2, off, &tolm, &tohm); rc = skx_get_hi_lo(0x09a2, off, &tolm, &tohm);
if (rc) if (rc)
return rc; return rc;
......
...@@ -1432,6 +1432,7 @@ static int pnd2_mce_check_error(struct notifier_block *nb, unsigned long val, vo ...@@ -1432,6 +1432,7 @@ static int pnd2_mce_check_error(struct notifier_block *nb, unsigned long val, vo
static struct notifier_block pnd2_mce_dec = { static struct notifier_block pnd2_mce_dec = {
.notifier_call = pnd2_mce_check_error, .notifier_call = pnd2_mce_check_error,
.priority = MCE_PRIO_EDAC,
}; };
#ifdef CONFIG_EDAC_DEBUG #ifdef CONFIG_EDAC_DEBUG
......
...@@ -164,7 +164,7 @@ static struct res_config skx_cfg = { ...@@ -164,7 +164,7 @@ static struct res_config skx_cfg = {
}; };
static const struct x86_cpu_id skx_cpuids[] = { static const struct x86_cpu_id skx_cpuids[] = {
X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X, &skx_cfg), X86_MATCH_INTEL_FAM6_MODEL_STEPPINGS(SKYLAKE_X, X86_STEPPINGS(0x0, 0xf), &skx_cfg),
{ } { }
}; };
MODULE_DEVICE_TABLE(x86cpu, skx_cpuids); MODULE_DEVICE_TABLE(x86cpu, skx_cpuids);
......
...@@ -594,27 +594,6 @@ struct mem_ctl_info { ...@@ -594,27 +594,6 @@ struct mem_ctl_info {
? (mci)->dimms[(dimm)->idx + 1] \ ? (mci)->dimms[(dimm)->idx + 1] \
: NULL) : NULL)
/**
* edac_get_dimm_by_index - Get DIMM info at @index from a memory
* controller
*
* @mci: MC descriptor struct mem_ctl_info
* @index: index in the memory controller's DIMM array
*
* Returns a struct dimm_info * or NULL on failure.
*/
static inline struct dimm_info *
edac_get_dimm_by_index(struct mem_ctl_info *mci, int index)
{
if (index < 0 || index >= mci->tot_dimms)
return NULL;
if (WARN_ON_ONCE(mci->dimms[index]->idx != index))
return NULL;
return mci->dimms[index];
}
/** /**
* edac_get_dimm - Get DIMM info from a memory controller given by * edac_get_dimm - Get DIMM info from a memory controller given by
* [layer0,layer1,layer2] position * [layer0,layer1,layer2] position
...@@ -650,6 +629,12 @@ static inline struct dimm_info *edac_get_dimm(struct mem_ctl_info *mci, ...@@ -650,6 +629,12 @@ static inline struct dimm_info *edac_get_dimm(struct mem_ctl_info *mci,
if (mci->n_layers > 2) if (mci->n_layers > 2)
index = index * mci->layers[2].size + layer2; index = index * mci->layers[2].size + layer2;
return edac_get_dimm_by_index(mci, index); if (index < 0 || index >= mci->tot_dimms)
return NULL;
if (WARN_ON_ONCE(mci->dimms[index]->idx != index))
return NULL;
return mci->dimms[index];
} }
#endif /* _LINUX_EDAC_H_ */ #endif /* _LINUX_EDAC_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment