From patchwork Mon Feb 2 02:42:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 5757971 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 E0D359F38B for ; Mon, 2 Feb 2015 02:41:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CDA22026F for ; Mon, 2 Feb 2015 02:41:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 217FB20260 for ; Mon, 2 Feb 2015 02:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812AbbBBCk6 (ORCPT ); Sun, 1 Feb 2015 21:40:58 -0500 Received: from mga03.intel.com ([134.134.136.65]:31968 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754854AbbBBCky (ORCPT ); Sun, 1 Feb 2015 21:40:54 -0500 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 01 Feb 2015 18:36:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="448488751" Received: from gerry-dev.bj.intel.com ([10.238.158.52]) by FMSMGA003.fm.intel.com with ESMTP; 01 Feb 2015 18:26:46 -0800 From: Jiang Liu To: "Rafael J. Wysocki" , Thomas Gleixner , Bjorn Helgaas , Yinghai Lu , Borislav Petkov , Lv Zheng , Len Brown Cc: Tony Luck , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, Jiang Liu Subject: [Patch v2 07/23] ACPI: Move the window flag logic to the combined parser Date: Mon, 2 Feb 2015 10:42:52 +0800 Message-Id: <1422844988-13854-8-git-send-email-jiang.liu@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1422844988-13854-1-git-send-email-jiang.liu@linux.intel.com> References: <1422844988-13854-1-git-send-email-jiang.liu@linux.intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 From: Thomas Gleixner Normal memory and io resources have window always set to false. Move the flag logic to the unified address space parser. Signed-off-by: Thomas Gleixner Signed-off-by: Jiang Liu --- drivers/acpi/resource.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 99903d196024..15d17937c431 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -53,7 +53,7 @@ static bool acpi_dev_resource_len_valid(u64 start, u64 end, u64 len, bool io) } static void acpi_dev_memresource_flags(struct resource *res, u64 len, - u8 write_protect, bool window) + u8 write_protect) { res->flags = IORESOURCE_MEM; @@ -62,9 +62,6 @@ static void acpi_dev_memresource_flags(struct resource *res, u64 len, if (write_protect == ACPI_READ_WRITE_MEMORY) res->flags |= IORESOURCE_MEM_WRITEABLE; - - if (window) - res->flags |= IORESOURCE_WINDOW; } static void acpi_dev_get_memresource(struct resource *res, u64 start, u64 len, @@ -72,7 +69,7 @@ static void acpi_dev_get_memresource(struct resource *res, u64 start, u64 len, { res->start = start; res->end = start + len - 1; - acpi_dev_memresource_flags(res, len, write_protect, false); + acpi_dev_memresource_flags(res, len, write_protect); } /** @@ -118,7 +115,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) EXPORT_SYMBOL_GPL(acpi_dev_resource_memory); static void acpi_dev_ioresource_flags(struct resource *res, u64 len, - u8 io_decode, bool window) + u8 io_decode) { res->flags = IORESOURCE_IO; @@ -130,9 +127,6 @@ static void acpi_dev_ioresource_flags(struct resource *res, u64 len, if (io_decode == ACPI_DECODE_16) res->flags |= IORESOURCE_IO_16BIT_ADDR; - - if (window) - res->flags |= IORESOURCE_WINDOW; } static void acpi_dev_get_ioresource(struct resource *res, u64 start, u64 len, @@ -140,7 +134,7 @@ static void acpi_dev_get_ioresource(struct resource *res, u64 start, u64 len, { res->start = start; res->end = start + len - 1; - acpi_dev_ioresource_flags(res, len, io_decode, false); + acpi_dev_ioresource_flags(res, len, io_decode); } /** @@ -183,7 +177,6 @@ static bool acpi_decode_space(struct resource *res, struct acpi_address64_attribute *attr) { u8 iodec = attr->granularity == 0xfff ? ACPI_DECODE_10 : ACPI_DECODE_16; - bool window = addr->producer_consumer == ACPI_PRODUCER; bool wp = addr->info.mem.write_protect; u64 len = attr->address_length; @@ -192,10 +185,10 @@ static bool acpi_decode_space(struct resource *res, switch (addr->resource_type) { case ACPI_MEMORY_RANGE: - acpi_dev_memresource_flags(res, len, wp, window); + acpi_dev_memresource_flags(res, len, wp); break; case ACPI_IO_RANGE: - acpi_dev_ioresource_flags(res, len, iodec, window); + acpi_dev_ioresource_flags(res, len, iodec); break; case ACPI_BUS_NUMBER_RANGE: res->flags = IORESOURCE_BUS; @@ -204,6 +197,9 @@ static bool acpi_decode_space(struct resource *res, return false; } + if (addr->producer_consumer == ACPI_PRODUCER) + res->flags |= IORESOURCE_WINDOW; + return !(res->flags & IORESOURCE_DISABLED); }