Commit 7917f9cd authored by Jane Chu's avatar Jane Chu Committed by Dan Williams

acpi/nfit: rely on mce->misc to determine poison granularity

nfit_handle_mec() hardcode poison granularity at L1_CACHE_BYTES.
Instead, let the driver rely on mce->misc register to determine
the poison granularity.
Suggested-by: default avatarDan Williams <dan.j.williams@intel.com>
Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarJane Chu <jane.chu@oracle.com>
Link: https://lore.kernel.org/r/20220422224508.440670-2-jane.chu@oracle.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent d43fae7c
...@@ -32,6 +32,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, ...@@ -32,6 +32,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,
*/ */
mutex_lock(&acpi_desc_lock); mutex_lock(&acpi_desc_lock);
list_for_each_entry(acpi_desc, &acpi_descs, list) { list_for_each_entry(acpi_desc, &acpi_descs, list) {
unsigned int align = 1UL << MCI_MISC_ADDR_LSB(mce->misc);
struct device *dev = acpi_desc->dev; struct device *dev = acpi_desc->dev;
int found_match = 0; int found_match = 0;
...@@ -63,8 +64,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, ...@@ -63,8 +64,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,
/* If this fails due to an -ENOMEM, there is little we can do */ /* If this fails due to an -ENOMEM, there is little we can do */
nvdimm_bus_add_badrange(acpi_desc->nvdimm_bus, nvdimm_bus_add_badrange(acpi_desc->nvdimm_bus,
ALIGN(mce->addr, L1_CACHE_BYTES), ALIGN_DOWN(mce->addr, align), align);
L1_CACHE_BYTES);
nvdimm_region_notify(nfit_spa->nd_region, nvdimm_region_notify(nfit_spa->nd_region,
NVDIMM_REVALIDATE_POISON); NVDIMM_REVALIDATE_POISON);
......
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