From patchwork Wed Oct 7 21:49:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 7347401 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 D9FFB9F1D5 for ; Wed, 7 Oct 2015 21:49:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0758220626 for ; Wed, 7 Oct 2015 21:49:59 +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 9C3BA2062F for ; Wed, 7 Oct 2015 21:49:57 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8F7D862507; Wed, 7 Oct 2015 14:49:57 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ml01.01.org (Postfix) with ESMTP id 586AC62501 for ; Wed, 7 Oct 2015 14:49:57 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 07 Oct 2015 14:49:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,651,1437462000"; d="scan'208";a="659904278" Received: from omniknight.lm.intel.com ([10.232.112.76]) by orsmga003.jf.intel.com with ESMTP; 07 Oct 2015 14:49:57 -0700 From: Vishal Verma To: linux-nvdimm@lists.01.org Subject: [PATCH 2/3] acpi: add a utility function for evaluating _FIT Date: Wed, 7 Oct 2015 15:49:36 -0600 Message-Id: <1444254577-23744-3-git-send-email-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444254577-23744-1-git-send-email-vishal.l.verma@intel.com> References: <1444254577-23744-1-git-send-email-vishal.l.verma@intel.com> Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_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 _FIT is an ACPI method to request an updated NFIT (Nvdimm Firmware Interface Table) after a hotplug event. Add a function to evaluate the _FIT method and return a buffer with the updated NFIT. Cc: Dan Williams Cc: Rafael J. Wysocki Cc: Cc: Signed-off-by: Vishal Verma --- drivers/acpi/utils.c | 23 +++++++++++++++++++++++ include/acpi/acpi_bus.h | 1 + 2 files changed, 24 insertions(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 475c907..78f7c69 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -614,6 +614,29 @@ acpi_status acpi_evaluate_lck(acpi_handle handle, int lock) } /** + * acpi_evaluate_fit: Evaluate _FIT method to get an updated NFIT + * @handle: ACPI device handle + * @buf: buffer for the updated NFIT + * + * Evaluate device's _FIT method if present to get an updated NFIT + */ +acpi_status acpi_evaluate_fit(acpi_handle handle, struct acpi_buffer **buf) +{ + acpi_status status; + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + + status = acpi_evaluate_object(handle, "_FIT", NULL, &buffer); + + if (ACPI_FAILURE(status)) + return status; + + *buf = &buffer; + + return status; +} +EXPORT_SYMBOL(acpi_evaluate_fit); + +/** * acpi_evaluate_dsm - evaluate device's _DSM method * @handle: ACPI device handle * @uuid: UUID of requested functions, should be 16 bytes diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 5ba8fb6..7483399 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -61,6 +61,7 @@ bool acpi_ata_match(acpi_handle handle); bool acpi_bay_match(acpi_handle handle); bool acpi_dock_match(acpi_handle handle); +acpi_status acpi_evaluate_fit(acpi_handle handle, struct acpi_buffer **buf); bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs); union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid, int rev, int func, union acpi_object *argv4);