From patchwork Tue Jun 7 13:31:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 9161283 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 9134C60801 for ; Tue, 7 Jun 2016 13:33:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 814F92656B for ; Tue, 7 Jun 2016 13:33:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75C7528179; Tue, 7 Jun 2016 13:33:34 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E96CC27248 for ; Tue, 7 Jun 2016 13:33:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAH72-0001O7-3u; Tue, 07 Jun 2016 13:32:08 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAH6U-0000q8-Ot for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2016 13:31:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 78D4393D; Tue, 7 Jun 2016 06:31:45 -0700 (PDT) Received: from red-moon.cambridge.arm.com (red-moon.cambridge.arm.com [10.1.203.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ADB2A3F213; Tue, 7 Jun 2016 06:31:08 -0700 (PDT) From: Lorenzo Pieralisi To: iommu@lists.linux-foundation.org Subject: [RFC PATCH v2 06/15] drivers: acpi: iort: enhance device identifiers mappings Date: Tue, 7 Jun 2016 14:31:01 +0100 Message-Id: <1465306270-27076-7-git-send-email-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1465306270-27076-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1465306270-27076-1-git-send-email-lorenzo.pieralisi@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160607_063135_044352_406D46CC X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Marc Zyngier , Tomasz Nowicki , Joerg Roedel , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Will Deacon , Sinan Kaya , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, Hanjun Guo , Jon Masters , Robin Murphy , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Current IORT code only allow to map device identifiers to the corresponding ITS group device id. This is not sufficient, in that current code does not allow device id mappings to components that sit between devices and ITS interrupt controllers (eg IOMMUs). This patch enhances the current IORT ids mapping API to cater for all mappings allowed by the IORT specification. Signed-off-by: Lorenzo Pieralisi Cc: Hanjun Guo Cc: Tomasz Nowicki Cc: "Rafael J. Wysocki" --- drivers/acpi/iort.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/iort.c b/drivers/acpi/iort.c index cfdde71..0ba6c8a 100644 --- a/drivers/acpi/iort.c +++ b/drivers/acpi/iort.c @@ -264,14 +264,14 @@ iort_find_dev_callback(struct acpi_iort_node *node, void *context) static struct acpi_iort_node * iort_dev_map_rid(struct acpi_iort_node *node, u32 rid_in, - u32 *rid_out) + u32 *rid_out, u8 type) { if (!node) goto out; /* Go upstream */ - while (node->type != ACPI_IORT_NODE_ITS_GROUP) { + while (node->type != type) { struct acpi_iort_id_mapping *id; int i, found = 0; @@ -346,7 +346,7 @@ iort_its_find_node_and_map_rid(struct pci_dev *pdev, u32 req_id, u32 *dev_id) return NULL; } - return iort_dev_map_rid(node, req_id, dev_id); + return iort_dev_map_rid(node, req_id, dev_id, ACPI_IORT_NODE_ITS_GROUP); } /**