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: 7347431 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 07181BEEA4 for ; Wed, 7 Oct 2015 21:50:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 202DE20622 for ; Wed, 7 Oct 2015 21:50:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B730220638 for ; Wed, 7 Oct 2015 21:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755248AbbJGVuA (ORCPT ); Wed, 7 Oct 2015 17:50:00 -0400 Received: from mga03.intel.com ([134.134.136.65]:27349 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753851AbbJGVuA (ORCPT ); Wed, 7 Oct 2015 17:50:00 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.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 Cc: Vishal Verma , Dan Williams , "Rafael J. Wysocki" , linux-acpi@vger.kernel.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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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);