From patchwork Thu Aug 3 06:27:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9878191 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A14BE60360 for ; Thu, 3 Aug 2017 06:27:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9365E28876 for ; Thu, 3 Aug 2017 06:27:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87F5B28879; Thu, 3 Aug 2017 06:27:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F266E28876 for ; Thu, 3 Aug 2017 06:27:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751079AbdHCG1k (ORCPT ); Thu, 3 Aug 2017 02:27:40 -0400 Received: from mga05.intel.com ([192.55.52.43]:9998 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751247AbdHCG1j (ORCPT ); Thu, 3 Aug 2017 02:27:39 -0400 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 02 Aug 2017 23:27:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,314,1498546800"; d="scan'208";a="295074803" Received: from unknown (HELO lvzheng-MOBLsp3.sh.intel.com) ([10.239.159.74]) by fmsmga004.fm.intel.com with ESMTP; 02 Aug 2017 23:27:36 -0700 From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Robert Moore , Len Brown , Lv Zheng , "David E . Box" Cc: Lv Zheng , linux-acpi@vger.kernel.org, Lorenzo Pieralisi Subject: [PATCH 13/15] ACPICA: Resources: Allow _DMA method in walk resources Date: Thu, 3 Aug 2017 14:27:35 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bob Moore ACPICA commit af661c00afac7aa481a961fa48c6540a99ad64a6 The _DMA object contains a resource template, this change adds support for the walk resources function so that ACPI devices containing a _DMA object can actually parse it to detect DMA ranges for the respective bus. Link: https://github.com/acpica/acpica/commit/af661c00 Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bob Moore Signed-off-by: Lv Zheng --- drivers/acpi/acpica/rsxface.c | 7 ++++--- include/acpi/acnames.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index 59a4f9e..be65e65 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c @@ -615,7 +615,7 @@ ACPI_EXPORT_SYMBOL(acpi_walk_resource_buffer) * device we are querying * name - Method name of the resources we want. * (METHOD_NAME__CRS, METHOD_NAME__PRS, or - * METHOD_NAME__AEI) + * METHOD_NAME__AEI or METHOD_NAME__DMA) * user_function - Called for each resource * context - Passed to user_function * @@ -641,11 +641,12 @@ acpi_walk_resources(acpi_handle device_handle, if (!device_handle || !user_function || !name || (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) && !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) && - !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI))) { + !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI) && + !ACPI_COMPARE_NAME(name, METHOD_NAME__DMA))) { return_ACPI_STATUS(AE_BAD_PARAMETER); } - /* Get the _CRS/_PRS/_AEI resource list */ + /* Get the _CRS/_PRS/_AEI/_DMA resource list */ buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; status = acpi_rs_get_method_data(device_handle, name, &buffer); diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index b421584..d8dd3bf 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h @@ -54,6 +54,7 @@ #define METHOD_NAME__CLS "_CLS" #define METHOD_NAME__CRS "_CRS" #define METHOD_NAME__DDN "_DDN" +#define METHOD_NAME__DMA "_DMA" #define METHOD_NAME__HID "_HID" #define METHOD_NAME__INI "_INI" #define METHOD_NAME__PLD "_PLD"