The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jane Chu <jane.chu@oracle.com>
To: dan.j.williams@intel.com, bp@alien8.de, hch@infradead.org,
	dave.hansen@intel.com, peterz@infradead.org, luto@kernel.org,
	david@fromorbit.com, djwong@kernel.org,
	linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev,
	linux-kernel@vger.kernel.org, x86@kernel.org
Cc: vishal.l.verma@intel.com, dave.jiang@intel.com, agk@redhat.com,
	snitzer@redhat.com, dm-devel@redhat.com, ira.weiny@intel.com,
	willy@infradead.org, vgoyal@redhat.com
Subject: [PATCH v8 1/7] acpi/nfit: rely on mce->misc to determine poison granularity
Date: Tue, 19 Apr 2022 20:04:29 -0600	[thread overview]
Message-ID: <20220420020435.90326-2-jane.chu@oracle.com> (raw)
In-Reply-To: <20220420020435.90326-1-jane.chu@oracle.com>

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>
Signed-off-by: Jane Chu <jane.chu@oracle.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


  reply	other threads:[~2022-04-20  2:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  2:04 [PATCH v8 0/7] DAX poison recovery Jane Chu
2022-04-20  2:04 ` Jane Chu [this message]
2022-04-21 19:25   ` [PATCH v8 1/7] acpi/nfit: rely on mce->misc to determine poison granularity Dan Williams
2022-04-20  2:04 ` [PATCH v8 2/7] x86/mce: relocate set{clear}_mce_nospec() functions Jane Chu
2022-04-21  6:50   ` Christoph Hellwig
2022-04-22  3:46     ` Jane Chu
2022-04-20  2:04 ` [PATCH v8 3/7] mce: fix set_mce_nospec to always unmap the whole page Jane Chu
2022-04-21  6:51   ` Christoph Hellwig
2022-04-22  3:47     ` Jane Chu
2022-04-21 19:26   ` Dan Williams
2022-04-20  2:04 ` [PATCH v8 4/7] dax: introduce DAX_RECOVERY_WRITE dax access mode Jane Chu
2022-04-21  6:57   ` Christoph Hellwig
2022-04-22  4:15     ` Jane Chu
2022-04-21 19:35   ` Dan Williams
2022-04-22  4:15     ` Jane Chu
2022-04-20  2:04 ` [PATCH v8 5/7] dax: add .recovery_write dax_operation Jane Chu
2022-04-21  6:57   ` Christoph Hellwig
2022-04-20  2:04 ` [PATCH v8 6/7] pmem: refactor pmem_clear_poison() Jane Chu
2022-04-20  2:04 ` [PATCH v8 7/7] pmem: implement pmem_recovery_write() Jane Chu
2022-04-20  6:26   ` Dan Williams
2022-04-20 17:01     ` Jane Chu
2022-04-20 17:05       ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220420020435.90326-2-jane.chu@oracle.com \
    --to=jane.chu@oracle.com \
    --cc=agk@redhat.com \
    --cc=bp@alien8.de \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=ira.weiny@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=snitzer@redhat.com \
    --cc=vgoyal@redhat.com \
    --cc=vishal.l.verma@intel.com \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox