public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Robin Murphy <robin.murphy@arm.com>,
	will@kernel.org, catalin.marinas@arm.com
Cc: guohanjun@huawei.com, sudeep.holla@arm.com,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Michael Petlan <mpetlan@redhat.com>
Subject: Re: [PATCH v2] ACPI/IORT: Check node revision for PMCG resources
Date: Tue, 8 Feb 2022 11:10:26 +0000	[thread overview]
Message-ID: <20220208111026.GA6233@lpieralisi> (raw)
In-Reply-To: <75628ae41c257fb73588f7bf1c4459160e04be2b.1643916258.git.robin.murphy@arm.com>

On Thu, Feb 03, 2022 at 07:31:24PM +0000, Robin Murphy wrote:
> The original version of the IORT PMCG definition had an oversight
> wherein there was no way to describe the second register page for an
> implementation using the recommended RELOC_CTRS feature. Although the
> spec was fixed, and the final patches merged to ACPICA and Linux written
> against the new version, it seems that some old firmware based on the
> original revision has survived and turned up in the wild.
> 
> Add a check for the original PMCG definition, and avoid filling in the
> second memory resource with nonsense if so. Otherwise it is likely that
> something horrible will happen when the PMCG driver attempts to probe.
> 
> Reported-by: Michael Petlan <mpetlan@redhat.com>
> Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG")
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> ---
> 
> v2: Simpler workaround, since I realised platform_get_resource()
>     should happily just skip over a zero-initialised hole in the
>     resource array.
> 
>  drivers/acpi/arm64/iort.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

Should we send it to stable kernels ?

I'd kindly ask Catalin/Will to pick it up please.

Thanks,
Lorenzo

> 
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 175397913be1..7092b94b2aae 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1371,9 +1371,17 @@ static void __init arm_smmu_v3_pmcg_init_resources(struct resource *res,
>  	res[0].start = pmcg->page0_base_address;
>  	res[0].end = pmcg->page0_base_address + SZ_4K - 1;
>  	res[0].flags = IORESOURCE_MEM;
> -	res[1].start = pmcg->page1_base_address;
> -	res[1].end = pmcg->page1_base_address + SZ_4K - 1;
> -	res[1].flags = IORESOURCE_MEM;
> +	/*
> +	 * The initial version in DEN0049C lacked a way to describe register
> +	 * page 1, which makes it broken for most PMCG implementations; in
> +	 * that case, just let the driver fail gracefully if it expects to
> +	 * find a second memory resource.
> +	 */
> +	if (node->revision > 0) {
> +		res[1].start = pmcg->page1_base_address;
> +		res[1].end = pmcg->page1_base_address + SZ_4K - 1;
> +		res[1].flags = IORESOURCE_MEM;
> +	}
>  
>  	if (pmcg->overflow_gsiv)
>  		acpi_iort_register_irq(pmcg->overflow_gsiv, "overflow",
> -- 
> 2.28.0.dirty
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-02-08 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03 19:31 [PATCH v2] ACPI/IORT: Check node revision for PMCG resources Robin Murphy
2022-02-08 11:10 ` Lorenzo Pieralisi [this message]
2022-02-09 18:24 ` Catalin Marinas

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=20220208111026.GA6233@lpieralisi \
    --to=lorenzo.pieralisi@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=guohanjun@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mpetlan@redhat.com \
    --cc=robin.murphy@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=will@kernel.org \
    /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