linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hpe.com>
To: mingo@kernel.org, bp@suse.de, dan.j.williams@intel.com,
	rjw@rjwysocki.net, akpm@linux-foundation.org
Cc: linux-nvdimm@lists.01.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Toshi Kani <toshi.kani@hpe.com>
Subject: [PATCH 3/3] ACPI: Change NFIT driver to set PMEM type to iomem entry
Date: Tue,  2 Feb 2016 11:55:11 -0700	[thread overview]
Message-ID: <1454439311-23690-4-git-send-email-toshi.kani@hpe.com> (raw)
In-Reply-To: <1454439311-23690-1-git-send-email-toshi.kani@hpe.com>

Change acpi_nfit_register_region() to call iomem_set_desc() with
IORES_DESC_PERSISTENT_MEMORY for NFIT_SPA_PM ranges found in ACPI
NFIT table.

When FW sets E820_PMEM in e820 and EFI_PERSISTENT_MEMORY in EFI,
this code simply sets PMEM type again to "Persistent Memory" entries
in the iomem table.  When FW sets reserved type for persistent
memory ranges, it sets PMEM type to "reserved" entries covering
PMEM ranges.

This allows the EINJ driver, which calls region_intersects() with
IORES_DESC_PERSISTENT_MEMORY to check persistent memory ranges,
to work continuously even if FW sets reserved type to persistent
memory in e820 and EFI.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/acpi/nfit.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index ad6d8c6..add04f0 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -1781,6 +1781,12 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc,
 
 	nvdimm_bus = acpi_desc->nvdimm_bus;
 	if (nfit_spa_type(spa) == NFIT_SPA_PM) {
+		rc = iomem_set_desc(spa->address, spa->length,
+					IORES_DESC_PERSISTENT_MEMORY);
+		if (rc)
+			dev_dbg(acpi_desc->dev,
+				"error setting iomem desc: %d\n", rc);
+
 		rc = acpi_nfit_find_poison(acpi_desc, ndr_desc);
 		if (rc) {
 			dev_err(acpi_desc->dev,

  parent reply	other threads:[~2016-02-02 18:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 18:55 [PATCH 0/3] Support persistent memory as reserved type in e820/EFI Toshi Kani
2016-02-02 18:55 ` [PATCH 1/3] resource: Make __request_region to inherit from immediate parent Toshi Kani
2016-02-02 18:55 ` [PATCH 2/3] resource: Add iomem_set_desc() to set I/O descriptor Toshi Kani
2016-02-02 18:55 ` Toshi Kani [this message]
2016-02-12 19:41   ` [PATCH 3/3] ACPI: Change NFIT driver to set PMEM type to iomem entry Dan Williams
2016-02-12 22:30     ` Toshi Kani
2016-02-12 23:32       ` Dan Williams
2016-02-17  2:00         ` Toshi Kani
2016-02-17 18:00           ` Toshi Kani
2016-02-17 19:34             ` Dan Williams
2016-02-17 22:56               ` Toshi Kani

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=1454439311-23690-4-git-send-email-toshi.kani@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@suse.de \
    --cc=dan.j.williams@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mingo@kernel.org \
    --cc=rjw@rjwysocki.net \
    /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;
as well as URLs for NNTP newsgroup(s).