[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220420020435.90326-2-jane.chu@oracle.com>
Date: Tue, 19 Apr 2022 20:04:29 -0600
From: Jane Chu <jane.chu@...cle.com>
To: dan.j.williams@...el.com, bp@...en8.de, hch@...radead.org,
dave.hansen@...el.com, peterz@...radead.org, luto@...nel.org,
david@...morbit.com, djwong@...nel.org,
linux-fsdevel@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-kernel@...r.kernel.org, x86@...nel.org
Cc: vishal.l.verma@...el.com, dave.jiang@...el.com, agk@...hat.com,
snitzer@...hat.com, dm-devel@...hat.com, ira.weiny@...el.com,
willy@...radead.org, vgoyal@...hat.com
Subject: [PATCH v8 1/7] 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@...el.com>
Signed-off-by: Jane Chu <jane.chu@...cle.com>
---
drivers/acpi/nfit/mce.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/nfit/mce.c b/drivers/acpi/nfit/mce.c
index ee8d9973f60b..d48a388b796e 100644
--- a/drivers/acpi/nfit/mce.c
+++ b/drivers/acpi/nfit/mce.c
@@ -32,6 +32,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,
*/
mutex_lock(&acpi_desc_lock);
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;
int found_match = 0;
@@ -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 */
nvdimm_bus_add_badrange(acpi_desc->nvdimm_bus,
- ALIGN(mce->addr, L1_CACHE_BYTES),
- L1_CACHE_BYTES);
+ ALIGN_DOWN(mce->addr, align), align);
nvdimm_region_notify(nfit_spa->nd_region,
NVDIMM_REVALIDATE_POISON);
--
2.18.4
Powered by blists - more mailing lists