From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: iommu@lists.linux-foundation.org
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Hanjun Guo <hanjun.guo@linaro.org>,
Tomasz Nowicki <tn@semihalf.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Will Deacon <will.deacon@arm.com>,
Marc Zyngier <marc.zyngier@arm.com>,
Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>, Jon Masters <jcm@redhat.com>,
Eric Auger <eric.auger@redhat.com>,
Sinan Kaya <okaya@codeaurora.org>,
Nate Watterson <nwatters@codeaurora.org>,
Prem Mallappa <prem.mallappa@broadcom.com>,
Dennis Chen <dennis.chen@arm.com>,
linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 14/16] drivers: acpi: iort: replace rid map type with type mask
Date: Mon, 21 Nov 2016 10:01:46 +0000 [thread overview]
Message-ID: <20161121100148.24769-15-lorenzo.pieralisi@arm.com> (raw)
In-Reply-To: <20161121100148.24769-1-lorenzo.pieralisi@arm.com>
IORT tables provide data that allow the kernel to carry out
device ID mappings between endpoints and system components
(eg interrupt controllers, IOMMUs). When the mapping for a
given device ID is carried out, the translation mechanism
is done on a per-subsystem basis rather than a component
subtype (ie the IOMMU kernel layer will look for mappings
from a device to all IORT node types corresponding to IOMMU
components), therefore the corresponding mapping API should
work on a range (ie mask) of IORT node types corresponding
to a common set of components (eg IOMMUs) rather than a
specific node type.
Upgrade the IORT iort_node_map_rid() API to work with a
type mask instead of a single node type so that it can
be used for mappings that span multiple components types
(ie IOMMUs).
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Tomasz Nowicki <tn@semihalf.com>
Tested-by: Hanjun Guo <hanjun.guo@linaro.org>
Tested-by: Tomasz Nowicki <tn@semihalf.com>
Cc: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Tomasz Nowicki <tn@semihalf.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
---
drivers/acpi/arm64/iort.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 8a8ae5e..f3bbef8 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -26,6 +26,9 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
+#define IORT_TYPE_MASK(type) (1 << (type))
+#define IORT_MSI_TYPE (1 << ACPI_IORT_NODE_ITS_GROUP)
+
struct iort_its_msi_chip {
struct list_head list;
struct fwnode_handle *fw_node;
@@ -317,7 +320,7 @@ static int iort_id_map(struct acpi_iort_id_mapping *map, u8 type, u32 rid_in,
static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node,
u32 rid_in, u32 *rid_out,
- u8 type)
+ u8 type_mask)
{
u32 rid = rid_in;
@@ -326,7 +329,7 @@ static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node,
struct acpi_iort_id_mapping *map;
int i;
- if (node->type == type) {
+ if (IORT_TYPE_MASK(node->type) & type_mask) {
if (rid_out)
*rid_out = rid;
return node;
@@ -399,7 +402,7 @@ u32 iort_msi_map_rid(struct device *dev, u32 req_id)
if (!node)
return req_id;
- iort_node_map_rid(node, req_id, &dev_id, ACPI_IORT_NODE_ITS_GROUP);
+ iort_node_map_rid(node, req_id, &dev_id, IORT_MSI_TYPE);
return dev_id;
}
@@ -421,7 +424,7 @@ static int iort_dev_find_its_id(struct device *dev, u32 req_id,
if (!node)
return -ENXIO;
- node = iort_node_map_rid(node, req_id, NULL, ACPI_IORT_NODE_ITS_GROUP);
+ node = iort_node_map_rid(node, req_id, NULL, IORT_MSI_TYPE);
if (!node)
return -ENXIO;
--
2.10.0
next prev parent reply other threads:[~2016-11-21 10:01 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 10:01 [PATCH v9 00/16] ACPI IORT ARM SMMU support Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 01/16] drivers: acpi: add FWNODE_ACPI_STATIC fwnode type Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 02/16] drivers: acpi: iort: introduce linker section for IORT entries probing Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 03/16] drivers: acpi: iort: add support for IOMMU fwnode registration Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 04/16] drivers: iommu: make of_iommu_set/get_ops() DT agnostic Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 05/16] drivers: iommu: arm-smmu: convert struct device of_node to fwnode usage Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 06/16] drivers: iommu: arm-smmu-v3: " Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 07/16] drivers: acpi: implement acpi_dma_configure Lorenzo Pieralisi
2016-12-02 15:38 ` Lorenzo Pieralisi
2016-12-03 2:11 ` Rafael J. Wysocki
2016-12-03 10:39 ` Lorenzo Pieralisi
2016-12-05 1:21 ` Rafael J. Wysocki
2016-12-05 9:52 ` Sricharan
2016-12-05 10:57 ` Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 08/16] drivers: acpi: iort: add node match function Lorenzo Pieralisi
2016-11-29 12:14 ` Hanjun Guo
2016-11-21 10:01 ` [PATCH v9 09/16] drivers: acpi: iort: add support for ARM SMMU platform devices creation Lorenzo Pieralisi
2016-11-29 12:17 ` Hanjun Guo
2016-11-21 10:01 ` [PATCH v9 10/16] drivers: iommu: arm-smmu-v3: split probe functions into DT/generic portions Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 11/16] drivers: iommu: arm-smmu-v3: add IORT configuration Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 12/16] drivers: iommu: arm-smmu: split probe functions into DT/generic portions Lorenzo Pieralisi
2016-11-21 10:01 ` [PATCH v9 13/16] drivers: iommu: arm-smmu: add IORT configuration Lorenzo Pieralisi
2016-11-21 10:01 ` Lorenzo Pieralisi [this message]
2016-11-29 12:29 ` [PATCH v9 14/16] drivers: acpi: iort: replace rid map type with type mask Hanjun Guo
2016-11-21 10:01 ` [PATCH v9 15/16] drivers: acpi: iort: add single mapping function Lorenzo Pieralisi
2016-11-30 3:22 ` Hanjun Guo
2016-11-21 10:01 ` [PATCH v9 16/16] drivers: acpi: iort: introduce iort_iommu_configure Lorenzo Pieralisi
2016-11-30 3:26 ` Hanjun Guo
2016-11-29 11:11 ` [PATCH v9 00/16] ACPI IORT ARM SMMU support Hanjun Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161121100148.24769-15-lorenzo.pieralisi@arm.com \
--to=lorenzo.pieralisi@arm.com \
--cc=dennis.chen@arm.com \
--cc=eric.auger@redhat.com \
--cc=hanjun.guo@linaro.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jcm@redhat.com \
--cc=joro@8bytes.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=nwatters@codeaurora.org \
--cc=okaya@codeaurora.org \
--cc=prem.mallappa@broadcom.com \
--cc=rjw@rjwysocki.net \
--cc=robin.murphy@arm.com \
--cc=tn@semihalf.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).