Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558276

Re: [PATCH v7 08/15] ACPI: IORT: rename iort_node_map_rid() to make it generic

From Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v7 08/15] ACPI: IORT: rename iort_node_map_rid() to make it generic
Date 2017-01-13 12:50 +0100
Message-ID <sZ8wN-kY-9@gated-at.bofh.it> (permalink)
References <sYsHf-8rV-5@gated-at.bofh.it> <sYsHg-8rV-47@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jan 11, 2017 at 11:06:32PM +0800, Hanjun Guo wrote:
> iort_node_map_rid() was designed for both PCI and platform
> device, but the rid means requester id is for ITS mappings,

I do not understand what this means sorry.

> rename iort_node_map_rid() to iort_node_map_id() and update
> its argument names to make it more generic.
> 

"iort_node_map_rid() was designed to take an input id (that is not
necessarily a PCI requester id) and map it to an output id (eg an SMMU
streamid or an ITS deviceid) according to the mappings provided by an
IORT node mapping entries. This means that the iort_node_map_rid() input
id is not always a PCI requester id as its name, parameters and local
variables suggest, which is misleading.

Apply the s/rid/id substitution to the iort_node_map_rid() mapping
function and its users to make sure its intended usage is clearer."

Lorenzo

> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Tomasz Nowicki <tn@semihalf.com>
> ---
>  drivers/acpi/arm64/iort.c | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 208eac9..069a690 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -355,11 +355,11 @@ struct acpi_iort_node *iort_node_get_id(struct acpi_iort_node *node,
>  	return NULL;
>  }
>  
> -static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node,
> -						u32 rid_in, u32 *rid_out,
> -						u8 type_mask)
> +static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node,
> +					       u32 id_in, u32 *id_out,
> +					       u8 type_mask)
>  {
> -	u32 rid = rid_in;
> +	u32 id = id_in;
>  
>  	/* Parse the ID mapping tree to find specified node type */
>  	while (node) {
> @@ -367,8 +367,8 @@ static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node,
>  		int i;
>  
>  		if (IORT_TYPE_MASK(node->type) & type_mask) {
> -			if (rid_out)
> -				*rid_out = rid;
> +			if (id_out)
> +				*id_out = id;
>  			return node;
>  		}
>  
> @@ -385,9 +385,9 @@ static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node,
>  			goto fail_map;
>  		}
>  
> -		/* Do the RID translation */
> +		/* Do the ID translation */
>  		for (i = 0; i < node->mapping_count; i++, map++) {
> -			if (!iort_id_map(map, node->type, rid, &rid))
> +			if (!iort_id_map(map, node->type, id, &id))
>  				break;
>  		}
>  
> @@ -399,9 +399,9 @@ static struct acpi_iort_node *iort_node_map_rid(struct acpi_iort_node *node,
>  	}
>  
>  fail_map:
> -	/* Map input RID to output RID unchanged on mapping failure*/
> -	if (rid_out)
> -		*rid_out = rid_in;
> +	/* Map input ID to output ID unchanged on mapping failure */
> +	if (id_out)
> +		*id_out = id_in;
>  
>  	return NULL;
>  }
> @@ -439,7 +439,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, IORT_MSI_TYPE);
> +	iort_node_map_id(node, req_id, &dev_id, IORT_MSI_TYPE);
>  	return dev_id;
>  }
>  
> @@ -462,7 +462,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, IORT_MSI_TYPE);
> +	node = iort_node_map_id(node, req_id, NULL, IORT_MSI_TYPE);
>  	if (!node)
>  		return -ENXIO;
>  
> @@ -591,8 +591,8 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev)
>  		if (!node)
>  			return NULL;
>  
> -		parent = iort_node_map_rid(node, rid, &streamid,
> -					   IORT_IOMMU_TYPE);
> +		parent = iort_node_map_id(node, rid, &streamid,
> +					  IORT_IOMMU_TYPE);
>  
>  		ops = iort_iommu_xlate(dev, parent, streamid);
>  
> -- 
> 1.9.1
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 00/15] ACPI platform MSI support and its example mbigen Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:10 +0100
  [PATCH v7 11/15] ACPI: platform: setup MSI domain for ACPI based platform device Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:10 +0100
  [PATCH v7 08/15] ACPI: IORT: rename iort_node_map_rid() to make it generic Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:10 +0100
    Re: [PATCH v7 08/15] ACPI: IORT: rename iort_node_map_rid() to make  it generic Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-01-13 12:50 +0100
      Re: [PATCH v7 08/15] ACPI: IORT: rename iort_node_map_rid() to make  it generic Hanjun Guo <guohanjun@huawei.com> - 2017-01-14 04:30 +0100
  [PATCH v7 03/15] ACPI: IORT: minor cleanup for iort_match_node_callback() Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:10 +0100
  [PATCH v7 12/15] msi: platform: make platform_msi_create_device_domain() ACPI aware Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:10 +0100
    Re: [PATCH v7 12/15] msi: platform: make  platform_msi_create_device_domain() ACPI aware Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-01-13 12:00 +0100
      Re: [PATCH v7 12/15] msi: platform: make  platform_msi_create_device_domain() ACPI aware Hanjun Guo <guohanjun@huawei.com> - 2017-01-14 04:10 +0100
  [PATCH v7 06/15] irqchip: gicv3-its: platform-msi: refactor its_pmsi_init() to prepare for ACPI Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:10 +0100
  [PATCH v7 14/15] irqchip: mbigen: introduce mbigen_of_create_domain() Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:10 +0100
  [PATCH v7 13/15] irqchip: mbigen: drop module owner Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:20 +0100
  [PATCH v7 10/15] ACPI: IORT: move over to iort_node_map_platform_id() Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:20 +0100
  [PATCH v7 02/15] ACPI: IORT: add missing comment for iort_dev_find_its_id() Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:20 +0100
  [PATCH v7 15/15] irqchip: mbigen: Add ACPI support Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:20 +0100
    Re: [PATCH v7 15/15] irqchip: mbigen: Add ACPI support Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-01-13 11:20 +0100
      Re: [PATCH v7 15/15] irqchip: mbigen: Add ACPI support Hanjun Guo <guohanjun@huawei.com> - 2017-01-14 04:10 +0100
        Re: [PATCH v7 15/15] irqchip: mbigen: Add ACPI support Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-01-16 12:40 +0100
          Re: [PATCH v7 15/15] irqchip: mbigen: Add ACPI support Hanjun Guo <guohanjun@huawei.com> - 2017-01-16 15:30 +0100
            Re: [PATCH v7 15/15] irqchip: mbigen: Add ACPI support Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2017-01-16 16:30 +0100
  [PATCH v7 01/15] ACPI: IORT: fix the indentation in iort_scan_node() Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-11 16:20 +0100
  Re: [PATCH v7 00/15] ACPI platform MSI support and its example mbigen Ming Lei <tom.leiming@gmail.com> - 2017-01-13 11:30 +0100
    Re: [PATCH v7 00/15] ACPI platform MSI support and its example mbigen Hanjun Guo <guohanjun@huawei.com> - 2017-01-14 02:10 +0100
  Re: [PATCH v7 00/15] ACPI platform MSI support and its example mbigen Wei Xu <xuwei5@hisilicon.com> - 2017-01-13 15:30 +0100
    Re: [PATCH v7 00/15] ACPI platform MSI support and its example mbigen Hanjun Guo <guohanjun@huawei.com> - 2017-01-14 05:40 +0100
  Re: [PATCH v7 00/15] ACPI platform MSI support and its example mbigen Sinan Kaya <okaya@codeaurora.org> - 2017-01-16 06:20 +0100

csiph-web