From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Pieralisi 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> References: <1465306270-27076-1-git-send-email-lorenzo.pieralisi@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1465306270-27076-1-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Cc: Marc Zyngier , Tomasz Nowicki , "Rafael J. Wysocki" , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Will Deacon , Sinan Kaya , linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Hanjun Guo , Jon Masters , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-acpi@vger.kernel.org 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); } /** -- 2.6.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932883AbcFGNbO (ORCPT ); Tue, 7 Jun 2016 09:31:14 -0400 Received: from foss.arm.com ([217.140.101.70]:44444 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755201AbcFGNbL (ORCPT ); Tue, 7 Jun 2016 09:31:11 -0400 From: Lorenzo Pieralisi To: iommu@lists.linux-foundation.org Cc: Lorenzo Pieralisi , Hanjun Guo , Tomasz Nowicki , "Rafael J. Wysocki" , Will Deacon , Marc Zyngier , Robin Murphy , Joerg Roedel , Jon Masters , Sinan Kaya , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } /** -- 2.6.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: 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> In-Reply-To: <1465306270-27076-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1465306270-27076-1-git-send-email-lorenzo.pieralisi@arm.com> 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 Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: 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); } /** -- 2.6.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi) Date: Tue, 7 Jun 2016 14:31:01 +0100 Subject: [RFC PATCH v2 06/15] drivers: acpi: iort: enhance device identifiers mappings In-Reply-To: <1465306270-27076-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1465306270-27076-1-git-send-email-lorenzo.pieralisi@arm.com> Message-ID: <1465306270-27076-7-git-send-email-lorenzo.pieralisi@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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); } /** -- 2.6.4