From patchwork Tue Feb 2 18:55:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kani, Toshi" X-Patchwork-Id: 8194311 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 196149FBE9 for ; Tue, 2 Feb 2016 18:56:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3CD5A202C8 for ; Tue, 2 Feb 2016 18:56:28 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 232B720306 for ; Tue, 2 Feb 2016 18:56:27 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 162EC1A21F5; Tue, 2 Feb 2016 10:56:27 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from g4t3425.houston.hp.com (g4t3425.houston.hp.com [15.201.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 845B81A21F8 for ; Tue, 2 Feb 2016 10:56:25 -0800 (PST) Received: from g9t2301.houston.hp.com (g9t2301.houston.hp.com [16.216.185.78]) by g4t3425.houston.hp.com (Postfix) with ESMTP id E890F4D; Tue, 2 Feb 2016 18:56:24 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.78.168.61]) by g9t2301.houston.hp.com (Postfix) with ESMTP id 3841C4F; Tue, 2 Feb 2016 18:56:24 +0000 (UTC) From: Toshi Kani To: mingo@kernel.org, bp@suse.de, dan.j.williams@intel.com, rjw@rjwysocki.net, akpm@linux-foundation.org Subject: [PATCH 3/3] ACPI: Change NFIT driver to set PMEM type to iomem entry Date: Tue, 2 Feb 2016 11:55:11 -0700 Message-Id: <1454439311-23690-4-git-send-email-toshi.kani@hpe.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1454439311-23690-1-git-send-email-toshi.kani@hpe.com> References: <1454439311-23690-1-git-send-email-toshi.kani@hpe.com> Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Rafael J. Wysocki Cc: Dan Williams Cc: Ingo Molnar Cc: Borislav Petkov Cc: Andrew Morton --- 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,