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: 8194331 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 01A46BEEE5 for ; Tue, 2 Feb 2016 18:56:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39AC2202F0 for ; Tue, 2 Feb 2016 18:56:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5F5A20270 for ; Tue, 2 Feb 2016 18:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964924AbcBBS4i (ORCPT ); Tue, 2 Feb 2016 13:56:38 -0500 Received: from g4t3425.houston.hp.com ([15.201.208.53]:29293 "EHLO g4t3425.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965398AbcBBS4Z (ORCPT ); Tue, 2 Feb 2016 13:56:25 -0500 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 Cc: linux-nvdimm@lists.01.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Toshi Kani 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,