Skip to content

Commit 7917f9c

Browse files
jchu314atgithubdjbw
authored andcommitted
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: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jane Chu <jane.chu@oracle.com> Link: https://lore.kernel.org/r/20220422224508.440670-2-jane.chu@oracle.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent d43fae7 commit 7917f9c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/acpi/nfit/mce.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,
3232
*/
3333
mutex_lock(&acpi_desc_lock);
3434
list_for_each_entry(acpi_desc, &acpi_descs, list) {
35+
unsigned int align = 1UL << MCI_MISC_ADDR_LSB(mce->misc);
3536
struct device *dev = acpi_desc->dev;
3637
int found_match = 0;
3738

@@ -63,8 +64,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,
6364

6465
/* If this fails due to an -ENOMEM, there is little we can do */
6566
nvdimm_bus_add_badrange(acpi_desc->nvdimm_bus,
66-
ALIGN(mce->addr, L1_CACHE_BYTES),
67-
L1_CACHE_BYTES);
67+
ALIGN_DOWN(mce->addr, align), align);
6868
nvdimm_region_notify(nfit_spa->nd_region,
6969
NVDIMM_REVALIDATE_POISON);
7070

0 commit comments

Comments
 (0)