linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] acpi/iort, numa: Add numa node mapping for smmuv3 devices
@ 2017-06-01 14:05 Ganapatrao Kulkarni
  2017-06-01 16:21 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 4+ messages in thread
From: Ganapatrao Kulkarni @ 2017-06-01 14:05 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-acpi, iommu
  Cc: Will.Deacon, lorenzo.pieralisi, hanjun.guo, sudeep.holla,
	robin.murphy, joro, rjw, lenb, jnair, gpkulkarni

ARM IORT specification has provision to define Proximity domain
in SMMUv3 IORT table. Adding required code to parse Proximity domain of
SMMUv3 IORT table. Parsed Proximity domain is used to set numa_node
of SMMUv3 platform devices.

Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
---
 drivers/iommu/arm-smmu-v3.c | 6 ++++++
 include/acpi/actbl2.h       | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 69d8506..98c2319 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -2667,6 +2667,12 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev,
 	if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE)
 		smmu->features |= ARM_SMMU_FEAT_COHERENCY;
 
+	/* set numa proximity domain for smmv3 device */
+	if (iort_smmu->flags & ACPI_IORT_SMMU_V3_PXM) {
+		set_dev_node(dev, acpi_map_pxm_to_node(iort_smmu->pxm));
+		dev_info(dev, "on NUMA node %d\n", dev_to_node(dev));
+	}
+
 	return 0;
 }
 #else
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 4b306a6..c16ced8 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -805,6 +805,9 @@ struct acpi_iort_smmu_v3 {
 	u32 pri_gsiv;
 	u32 gerr_gsiv;
 	u32 sync_gsiv;
+	u8 pxm;
+	u8 reserved1;
+	u16 reserved2;
 };
 
 /* Values for Model field above */
@@ -817,6 +820,7 @@ struct acpi_iort_smmu_v3 {
 
 #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
 #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (1<<1)
+#define ACPI_IORT_SMMU_V3_PXM               (1<<3)
 
 /*******************************************************************************
  *
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi/iort, numa: Add numa node mapping for smmuv3 devices
  2017-06-01 14:05 [PATCH] acpi/iort, numa: Add numa node mapping for smmuv3 devices Ganapatrao Kulkarni
@ 2017-06-01 16:21 ` Lorenzo Pieralisi
  2017-06-02  3:50   ` Hanjun Guo
  0 siblings, 1 reply; 4+ messages in thread
From: Lorenzo Pieralisi @ 2017-06-01 16:21 UTC (permalink / raw)
  To: Ganapatrao Kulkarni
  Cc: linux-kernel, linux-arm-kernel, linux-acpi, iommu, Will.Deacon,
	hanjun.guo, sudeep.holla, robin.murphy, joro, rjw, lenb, jnair,
	gpkulkarni

On Thu, Jun 01, 2017 at 07:35:37PM +0530, Ganapatrao Kulkarni wrote:
> ARM IORT specification has provision to define Proximity domain
> in SMMUv3 IORT table. Adding required code to parse Proximity domain of
> SMMUv3 IORT table. Parsed Proximity domain is used to set numa_node
> of SMMUv3 platform devices.
> 
> Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
> ---
>  drivers/iommu/arm-smmu-v3.c | 6 ++++++
>  include/acpi/actbl2.h       | 4 ++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 69d8506..98c2319 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -2667,6 +2667,12 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev,
>  	if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE)
>  		smmu->features |= ARM_SMMU_FEAT_COHERENCY;
>  
> +	/* set numa proximity domain for smmv3 device */
> +	if (iort_smmu->flags & ACPI_IORT_SMMU_V3_PXM) {
> +		set_dev_node(dev, acpi_map_pxm_to_node(iort_smmu->pxm));
> +		dev_info(dev, "on NUMA node %d\n", dev_to_node(dev));

It should be done in acpi/arm64/iort.c at device creation time.

Thanks,
Lorenzo

> +	}
> +
>  	return 0;
>  }
>  #else
> diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
> index 4b306a6..c16ced8 100644
> --- a/include/acpi/actbl2.h
> +++ b/include/acpi/actbl2.h
> @@ -805,6 +805,9 @@ struct acpi_iort_smmu_v3 {
>  	u32 pri_gsiv;
>  	u32 gerr_gsiv;
>  	u32 sync_gsiv;
> +	u8 pxm;
> +	u8 reserved1;
> +	u16 reserved2;
>  };
>  
>  /* Values for Model field above */
> @@ -817,6 +820,7 @@ struct acpi_iort_smmu_v3 {
>  
>  #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
>  #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (1<<1)
> +#define ACPI_IORT_SMMU_V3_PXM               (1<<3)
>  
>  /*******************************************************************************
>   *
> -- 
> 1.8.1.4
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi/iort, numa: Add numa node mapping for smmuv3 devices
  2017-06-01 16:21 ` Lorenzo Pieralisi
@ 2017-06-02  3:50   ` Hanjun Guo
  2017-06-04  4:04     ` Ganapatrao Kulkarni
  0 siblings, 1 reply; 4+ messages in thread
From: Hanjun Guo @ 2017-06-02  3:50 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Ganapatrao Kulkarni
  Cc: linux-kernel, linux-arm-kernel, linux-acpi, iommu, Will.Deacon,
	hanjun.guo, sudeep.holla, robin.murphy, joro, rjw, lenb, jnair,
	gpkulkarni, Lv Zheng

[+Cc Lv Zheng]

On 2017/6/2 0:21, Lorenzo Pieralisi wrote:
> On Thu, Jun 01, 2017 at 07:35:37PM +0530, Ganapatrao Kulkarni wrote:
>> ARM IORT specification has provision to define Proximity domain
>> in SMMUv3 IORT table. Adding required code to parse Proximity domain of
>> SMMUv3 IORT table. Parsed Proximity domain is used to set numa_node
>> of SMMUv3 platform devices.
>>
>> Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
>> ---
>>  drivers/iommu/arm-smmu-v3.c | 6 ++++++
>>  include/acpi/actbl2.h       | 4 ++++
>>  2 files changed, 10 insertions(+)
>>
>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>> index 69d8506..98c2319 100644
>> --- a/drivers/iommu/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm-smmu-v3.c
>> @@ -2667,6 +2667,12 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev,
>>  	if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE)
>>  		smmu->features |= ARM_SMMU_FEAT_COHERENCY;
>>  
>> +	/* set numa proximity domain for smmv3 device */
>> +	if (iort_smmu->flags & ACPI_IORT_SMMU_V3_PXM) {
>> +		set_dev_node(dev, acpi_map_pxm_to_node(iort_smmu->pxm));
>> +		dev_info(dev, "on NUMA node %d\n", dev_to_node(dev));
> It should be done in acpi/arm64/iort.c at device creation time.

Agreed.

>
>> +	}
>> +
>>  	return 0;
>>  }
>>  #else
>> diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
>> index 4b306a6..c16ced8 100644
>> --- a/include/acpi/actbl2.h
>> +++ b/include/acpi/actbl2.h
>> @@ -805,6 +805,9 @@ struct acpi_iort_smmu_v3 {
>>  	u32 pri_gsiv;
>>  	u32 gerr_gsiv;
>>  	u32 sync_gsiv;
>> +	u8 pxm;
>> +	u8 reserved1;
>> +	u16 reserved2;

I think changes to actbl2.h need to be split as a new patch
which go via ACPICA updates,  Lv, could you share
your comments here?

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi/iort, numa: Add numa node mapping for smmuv3 devices
  2017-06-02  3:50   ` Hanjun Guo
@ 2017-06-04  4:04     ` Ganapatrao Kulkarni
  0 siblings, 0 replies; 4+ messages in thread
From: Ganapatrao Kulkarni @ 2017-06-04  4:04 UTC (permalink / raw)
  To: Hanjun Guo
  Cc: Lorenzo Pieralisi, Ganapatrao Kulkarni, linux-kernel,
	linux-arm-kernel, linux-acpi, iommu, Will Deacon, Hanjun Guo,
	sudeep.holla, robin.murphy, joro, Rafael J. Wysocki, Len Brown,
	Jayachandran C, Lv Zheng

On Fri, Jun 2, 2017 at 9:20 AM, Hanjun Guo <guohanjun@huawei.com> wrote:
> [+Cc Lv Zheng]
>
> On 2017/6/2 0:21, Lorenzo Pieralisi wrote:
>> On Thu, Jun 01, 2017 at 07:35:37PM +0530, Ganapatrao Kulkarni wrote:
>>> ARM IORT specification has provision to define Proximity domain
>>> in SMMUv3 IORT table. Adding required code to parse Proximity domain of
>>> SMMUv3 IORT table. Parsed Proximity domain is used to set numa_node
>>> of SMMUv3 platform devices.
>>>
>>> Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
>>> ---
>>>  drivers/iommu/arm-smmu-v3.c | 6 ++++++
>>>  include/acpi/actbl2.h       | 4 ++++
>>>  2 files changed, 10 insertions(+)
>>>
>>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>>> index 69d8506..98c2319 100644
>>> --- a/drivers/iommu/arm-smmu-v3.c
>>> +++ b/drivers/iommu/arm-smmu-v3.c
>>> @@ -2667,6 +2667,12 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev,
>>>      if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE)
>>>              smmu->features |= ARM_SMMU_FEAT_COHERENCY;
>>>
>>> +    /* set numa proximity domain for smmv3 device */
>>> +    if (iort_smmu->flags & ACPI_IORT_SMMU_V3_PXM) {
>>> +            set_dev_node(dev, acpi_map_pxm_to_node(iort_smmu->pxm));
>>> +            dev_info(dev, "on NUMA node %d\n", dev_to_node(dev));
>> It should be done in acpi/arm64/iort.c at device creation time.
>
> Agreed.

thanks Lorenzo, i will update in next patch version.
>
>>
>>> +    }
>>> +
>>>      return 0;
>>>  }
>>>  #else
>>> diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
>>> index 4b306a6..c16ced8 100644
>>> --- a/include/acpi/actbl2.h
>>> +++ b/include/acpi/actbl2.h
>>> @@ -805,6 +805,9 @@ struct acpi_iort_smmu_v3 {
>>>      u32 pri_gsiv;
>>>      u32 gerr_gsiv;
>>>      u32 sync_gsiv;
>>> +    u8 pxm;
>>> +    u8 reserved1;
>>> +    u16 reserved2;
>
> I think changes to actbl2.h need to be split as a new patch
> which go via ACPICA updates,  Lv, could you share
> your comments here?

thanks Hanjun, looks like the changes should go to acpica repo and it should get
pulled in kernel.

Lv, can you please suggest on what should be done?
>
> Thanks
> Hanjun
>

thanks
Ganapat

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-04  4:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01 14:05 [PATCH] acpi/iort, numa: Add numa node mapping for smmuv3 devices Ganapatrao Kulkarni
2017-06-01 16:21 ` Lorenzo Pieralisi
2017-06-02  3:50   ` Hanjun Guo
2017-06-04  4:04     ` Ganapatrao Kulkarni

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).