Linux-ACPI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ACPI/IORT: Fix PMCG node always look for a single ID mapping.
@ 2020-05-11 20:22 Tuan Phan
  2020-05-12 10:40 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 3+ messages in thread
From: Tuan Phan @ 2020-05-11 20:22 UTC (permalink / raw)
  To: patches
  Cc: Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Rafael J. Wysocki,
	Len Brown, linux-acpi, linux-arm-kernel, linux-kernel

PMCG node can have zero ID mapping if its overflow interrupt
is wire based. The code to parse PMCG node can not assume it will
have a single ID mapping.

Signed-off-by: Tuan Phan <tuanphan@os.amperecomputing.com>
---
 drivers/acpi/arm64/iort.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index ed3d2d1..72444e1 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -441,7 +441,9 @@ static int iort_get_id_mapping_index(struct acpi_iort_node *node)
 
 		return smmu->id_mapping_index;
 	case ACPI_IORT_NODE_PMCG:
-		return 0;
+		if (node->mapping_count)
+			return 0;
+		return -EINVAL;
 	default:
 		return -EINVAL;
 	}
-- 
2.7.4


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

* Re: [PATCH] ACPI/IORT: Fix PMCG node always look for a single ID mapping.
  2020-05-11 20:22 [PATCH] ACPI/IORT: Fix PMCG node always look for a single ID mapping Tuan Phan
@ 2020-05-12 10:40 ` Lorenzo Pieralisi
  2020-05-12 23:53   ` Tuan Phan
  0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Pieralisi @ 2020-05-12 10:40 UTC (permalink / raw)
  To: Tuan Phan
  Cc: patches, Hanjun Guo, Sudeep Holla, Rafael J. Wysocki, Len Brown,
	linux-acpi, linux-arm-kernel, linux-kernel

On Mon, May 11, 2020 at 01:22:56PM -0700, Tuan Phan wrote:
> PMCG node can have zero ID mapping if its overflow interrupt
> is wire based. The code to parse PMCG node can not assume it will
> have a single ID mapping.
> 
> Signed-off-by: Tuan Phan <tuanphan@os.amperecomputing.com>
> ---
>  drivers/acpi/arm64/iort.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index ed3d2d1..72444e1 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -441,7 +441,9 @@ static int iort_get_id_mapping_index(struct acpi_iort_node *node)
>  
>  		return smmu->id_mapping_index;
>  	case ACPI_IORT_NODE_PMCG:
> -		return 0;
> +		if (node->mapping_count)
> +			return 0;

Check struct acpi_iort_pmcg->overflow_gsiv to be coherent with SMMUv3
code.

Lorenzo

> +		return -EINVAL;
>  	default:
>  		return -EINVAL;
>  	}
> -- 
> 2.7.4
> 

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

* Re: [PATCH] ACPI/IORT: Fix PMCG node always look for a single ID mapping.
  2020-05-12 10:40 ` Lorenzo Pieralisi
@ 2020-05-12 23:53   ` Tuan Phan
  0 siblings, 0 replies; 3+ messages in thread
From: Tuan Phan @ 2020-05-12 23:53 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Tuan Phan, patches, Hanjun Guo, Sudeep Holla, Rafael J. Wysocki,
	Len Brown, linux-acpi, linux-arm-kernel, linux-kernel



> On May 12, 2020, at 3:40 AM, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> wrote:
> 
> On Mon, May 11, 2020 at 01:22:56PM -0700, Tuan Phan wrote:
>> PMCG node can have zero ID mapping if its overflow interrupt
>> is wire based. The code to parse PMCG node can not assume it will
>> have a single ID mapping.
>> 
>> Signed-off-by: Tuan Phan <tuanphan@os.amperecomputing.com>
>> ---
>> drivers/acpi/arm64/iort.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
>> index ed3d2d1..72444e1 100644
>> --- a/drivers/acpi/arm64/iort.c
>> +++ b/drivers/acpi/arm64/iort.c
>> @@ -441,7 +441,9 @@ static int iort_get_id_mapping_index(struct acpi_iort_node *node)
>> 
>> 		return smmu->id_mapping_index;
>> 	case ACPI_IORT_NODE_PMCG:
>> -		return 0;
>> +		if (node->mapping_count)
>> +			return 0;
> 
> Check struct acpi_iort_pmcg->overflow_gsiv to be coherent with SMMUv3
> code.
> 
> Lorenzo

Sure, I will fix it.
> 
>> +		return -EINVAL;
>> 	default:
>> 		return -EINVAL;
>> 	}
>> -- 
>> 2.7.4
>> 


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 20:22 [PATCH] ACPI/IORT: Fix PMCG node always look for a single ID mapping Tuan Phan
2020-05-12 10:40 ` Lorenzo Pieralisi
2020-05-12 23:53   ` Tuan Phan

Linux-ACPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-acpi/0 linux-acpi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-acpi linux-acpi/ https://lore.kernel.org/linux-acpi \
		linux-acpi@vger.kernel.org
	public-inbox-index linux-acpi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-acpi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git