From patchwork Fri Oct 11 12:18:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 3023801 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C6C80BF924 for ; Fri, 11 Oct 2013 12:21:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3755201ED for ; Fri, 11 Oct 2013 12:21:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0AF6C20237 for ; Fri, 11 Oct 2013 12:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757180Ab3JKMUW (ORCPT ); Fri, 11 Oct 2013 08:20:22 -0400 Received: from mga01.intel.com ([192.55.52.88]:53424 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752713Ab3JKMUT (ORCPT ); Fri, 11 Oct 2013 08:20:19 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 11 Oct 2013 05:20:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,1080,1371106800"; d="scan'208";a="415445797" Received: from unknown (HELO localhost) ([10.255.21.2]) by fmsmga002.fm.intel.com with ESMTP; 11 Oct 2013 05:20:16 -0700 From: tianyu.lan@intel.com To: lenb@kernel.org, rjw@sisk.pl, yinghai@kernel.org, bhelgaas@google.com Cc: Lan Tianyu , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Resend PATCH 2/5] ACPI/Resource: Add address translation support Date: Fri, 11 Oct 2013 20:18:58 +0800 Message-Id: <1381493941-4650-3-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1381493941-4650-1-git-send-email-tianyu.lan@intel.com> References: <1381493941-4650-1-git-send-email-tianyu.lan@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=-7.1 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 From: Lan Tianyu According ACPI 5.0 spec Section 19.1.8 "For bridges, translate addresses across the bridge, this is the offset that must be added to the address on the secondary side to obtain the address on the primary side. Non-bridge devices must list 0." This patch is to add address translation offset to the start/end of struct resource in the acpi_dev_resource_address_space(). Further more, non-bridge device's translation_offset should 0. So this change will affect other devices. Signed-off-by: Lan Tianyu Acked-by: Bjorn Helgaas --- drivers/acpi/resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 929f416..84bc3db 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -192,8 +192,8 @@ bool acpi_dev_resource_address_space(struct acpi_resource *ares, if (ACPI_FAILURE(status)) return true; - res->start = addr.minimum; - res->end = addr.maximum; + res->start = addr.minimum + addr.translation_offset; + res->end = addr.maximum + addr.translation_offset; window = addr.producer_consumer == ACPI_PRODUCER; switch(addr.resource_type) {