linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
@ 2019-06-19 12:18 Ard Biesheuvel
  2019-06-19 12:24 ` Sudeep Holla
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Ard Biesheuvel @ 2019-06-19 12:18 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: lorenzo.pieralisi, Ard Biesheuvel, catalin.marinas, will.deacon,
	leif.lindholm, linux-acpi, lee.jones

Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
are clearly ACPI 5.1 based, given that that is the first ACPI revision
that supports ARM, and introduced the FADT 'arm_boot_flags' field,
which has a non-zero field on those systems.

So in these cases, infer from the ARM boot flags that the FADT must be
5.1 or later, and treat it as 5.1.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/kernel/acpi.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 803f0494dd3e..7722e85fb69c 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -155,10 +155,14 @@ static int __init acpi_fadt_sanity_check(void)
 	 */
 	if (table->revision < 5 ||
 	   (table->revision == 5 && fadt->minor_revision < 1)) {
-		pr_err("Unsupported FADT revision %d.%d, should be 5.1+\n",
+		pr_err(FW_BUG "Unsupported FADT revision %d.%d, should be 5.1+\n",
 		       table->revision, fadt->minor_revision);
-		ret = -EINVAL;
-		goto out;
+
+		if (!fadt->arm_boot_flags) {
+			ret = -EINVAL;
+			goto out;
+		}
+		pr_err("FADT has ARM boot flags set, assuming 5.1\n");
 	}
 
 	if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) {
-- 
2.20.1


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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-19 12:18 [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Ard Biesheuvel
@ 2019-06-19 12:24 ` Sudeep Holla
  2019-06-20  7:57   ` Lee Jones
  2019-06-19 12:26 ` Lee Jones
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Sudeep Holla @ 2019-06-19 12:24 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: lorenzo.pieralisi, catalin.marinas, will.deacon, leif.lindholm,
	linux-acpi, Sudeep Holla, lee.jones, linux-arm-kernel

On Wed, Jun 19, 2019 at 02:18:31PM +0200, Ard Biesheuvel wrote:
> Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> are clearly ACPI 5.1 based, given that that is the first ACPI revision
> that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> which has a non-zero field on those systems.
> 
> So in these cases, infer from the ARM boot flags that the FADT must be
> 5.1 or later, and treat it as 5.1.
> 

Makes sense and looks simple to me.

Acked-by: Sudeep Holla <sudeep.holla@arm.com>

--
Regards,
Sudeep

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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-19 12:18 [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Ard Biesheuvel
  2019-06-19 12:24 ` Sudeep Holla
@ 2019-06-19 12:26 ` Lee Jones
  2019-06-20  7:53 ` Graeme Gregory
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2019-06-19 12:26 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: lorenzo.pieralisi, catalin.marinas, will.deacon, leif.lindholm,
	linux-acpi, linux-arm-kernel

On Wed, 19 Jun 2019, Ard Biesheuvel wrote:

> Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> are clearly ACPI 5.1 based, given that that is the first ACPI revision
> that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> which has a non-zero field on those systems.
> 
> So in these cases, infer from the ARM boot flags that the FADT must be
> 5.1 or later, and treat it as 5.1.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/arm64/kernel/acpi.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 803f0494dd3e..7722e85fb69c 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -155,10 +155,14 @@ static int __init acpi_fadt_sanity_check(void)
>  	 */
>  	if (table->revision < 5 ||
>  	   (table->revision == 5 && fadt->minor_revision < 1)) {
> -		pr_err("Unsupported FADT revision %d.%d, should be 5.1+\n",
> +		pr_err(FW_BUG "Unsupported FADT revision %d.%d, should be 5.1+\n",
>  		       table->revision, fadt->minor_revision);
> -		ret = -EINVAL;
> -		goto out;
> +
> +		if (!fadt->arm_boot_flags) {
> +			ret = -EINVAL;
> +			goto out;
> +		}
> +		pr_err("FADT has ARM boot flags set, assuming 5.1\n");

Tested-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-19 12:18 [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Ard Biesheuvel
  2019-06-19 12:24 ` Sudeep Holla
  2019-06-19 12:26 ` Lee Jones
@ 2019-06-20  7:53 ` Graeme Gregory
  2019-06-20  9:43 ` Lorenzo Pieralisi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Graeme Gregory @ 2019-06-20  7:53 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: lorenzo.pieralisi, catalin.marinas, will.deacon, leif.lindholm,
	linux-acpi, lee.jones, linux-arm-kernel

On Wed, Jun 19, 2019 at 02:18:31PM +0200, Ard Biesheuvel wrote:
> Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> are clearly ACPI 5.1 based, given that that is the first ACPI revision
> that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> which has a non-zero field on those systems.
> 
> So in these cases, infer from the ARM boot flags that the FADT must be
> 5.1 or later, and treat it as 5.1.
> 

Makes sense, I did actually see this in the wild in SBSA machine too
once.

Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org>

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/arm64/kernel/acpi.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 803f0494dd3e..7722e85fb69c 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -155,10 +155,14 @@ static int __init acpi_fadt_sanity_check(void)
>  	 */
>  	if (table->revision < 5 ||
>  	   (table->revision == 5 && fadt->minor_revision < 1)) {
> -		pr_err("Unsupported FADT revision %d.%d, should be 5.1+\n",
> +		pr_err(FW_BUG "Unsupported FADT revision %d.%d, should be 5.1+\n",
>  		       table->revision, fadt->minor_revision);
> -		ret = -EINVAL;
> -		goto out;
> +
> +		if (!fadt->arm_boot_flags) {
> +			ret = -EINVAL;
> +			goto out;
> +		}
> +		pr_err("FADT has ARM boot flags set, assuming 5.1\n");
>  	}
>  
>  	if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) {
> -- 
> 2.20.1
> 

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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-19 12:24 ` Sudeep Holla
@ 2019-06-20  7:57   ` Lee Jones
  2019-06-20  9:49     ` Lorenzo Pieralisi
  0 siblings, 1 reply; 10+ messages in thread
From: Lee Jones @ 2019-06-20  7:57 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: lorenzo.pieralisi, Ard Biesheuvel, catalin.marinas, will.deacon,
	leif.lindholm, linux-acpi, linux-arm-kernel

On Wed, 19 Jun 2019, Sudeep Holla wrote:

> On Wed, Jun 19, 2019 at 02:18:31PM +0200, Ard Biesheuvel wrote:
> > Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> > are clearly ACPI 5.1 based, given that that is the first ACPI revision
> > that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> > which has a non-zero field on those systems.
> > 
> > So in these cases, infer from the ARM boot flags that the FADT must be
> > 5.1 or later, and treat it as 5.1.
> > 
> 
> Makes sense and looks simple to me.
> 
> Acked-by: Sudeep Holla <sudeep.holla@arm.com>

Could we pleeeeease have this in for v5.3?

We have available, consumer-level platforms that rely on this change.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-19 12:18 [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Ard Biesheuvel
                   ` (2 preceding siblings ...)
  2019-06-20  7:53 ` Graeme Gregory
@ 2019-06-20  9:43 ` Lorenzo Pieralisi
  2019-06-24  6:39 ` Hanjun Guo
  2019-06-24 14:55 ` Catalin Marinas
  5 siblings, 0 replies; 10+ messages in thread
From: Lorenzo Pieralisi @ 2019-06-20  9:43 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: catalin.marinas, will.deacon, leif.lindholm, linux-acpi,
	lee.jones, linux-arm-kernel

On Wed, Jun 19, 2019 at 02:18:31PM +0200, Ard Biesheuvel wrote:
> Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> are clearly ACPI 5.1 based, given that that is the first ACPI revision
> that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> which has a non-zero field on those systems.
> 
> So in these cases, infer from the ARM boot flags that the FADT must be
> 5.1 or later, and treat it as 5.1.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/arm64/kernel/acpi.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

AFAICS this should be harmless, so:

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

> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 803f0494dd3e..7722e85fb69c 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -155,10 +155,14 @@ static int __init acpi_fadt_sanity_check(void)
>  	 */
>  	if (table->revision < 5 ||
>  	   (table->revision == 5 && fadt->minor_revision < 1)) {
> -		pr_err("Unsupported FADT revision %d.%d, should be 5.1+\n",
> +		pr_err(FW_BUG "Unsupported FADT revision %d.%d, should be 5.1+\n",
>  		       table->revision, fadt->minor_revision);
> -		ret = -EINVAL;
> -		goto out;
> +
> +		if (!fadt->arm_boot_flags) {
> +			ret = -EINVAL;
> +			goto out;
> +		}
> +		pr_err("FADT has ARM boot flags set, assuming 5.1\n");
>  	}
>  
>  	if (!(fadt->flags & ACPI_FADT_HW_REDUCED)) {
> -- 
> 2.20.1
> 

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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-20  7:57   ` Lee Jones
@ 2019-06-20  9:49     ` Lorenzo Pieralisi
  2019-06-20 12:25       ` Lee Jones
  0 siblings, 1 reply; 10+ messages in thread
From: Lorenzo Pieralisi @ 2019-06-20  9:49 UTC (permalink / raw)
  To: Lee Jones
  Cc: Ard Biesheuvel, catalin.marinas, will.deacon, leif.lindholm,
	linux-acpi, Sudeep Holla, linux-arm-kernel

On Thu, Jun 20, 2019 at 08:57:32AM +0100, Lee Jones wrote:
> On Wed, 19 Jun 2019, Sudeep Holla wrote:
> 
> > On Wed, Jun 19, 2019 at 02:18:31PM +0200, Ard Biesheuvel wrote:
> > > Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> > > are clearly ACPI 5.1 based, given that that is the first ACPI revision
> > > that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> > > which has a non-zero field on those systems.
> > > 
> > > So in these cases, infer from the ARM boot flags that the FADT must be
> > > 5.1 or later, and treat it as 5.1.
> > > 
> > 
> > Makes sense and looks simple to me.
> > 
> > Acked-by: Sudeep Holla <sudeep.holla@arm.com>
> 
> Could we pleeeeease have this in for v5.3?
> 
> We have available, consumer-level platforms that rely on this change.

But we do not have the kernel infrastructure to support them so
I am fine with it but urgency is questionable as far as I am
concerned.

Lorenzo

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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-20  9:49     ` Lorenzo Pieralisi
@ 2019-06-20 12:25       ` Lee Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2019-06-20 12:25 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Ard Biesheuvel, catalin.marinas, will.deacon, leif.lindholm,
	linux-acpi, Sudeep Holla, linux-arm-kernel

On Thu, 20 Jun 2019, Lorenzo Pieralisi wrote:

> On Thu, Jun 20, 2019 at 08:57:32AM +0100, Lee Jones wrote:
> > On Wed, 19 Jun 2019, Sudeep Holla wrote:
> > 
> > > On Wed, Jun 19, 2019 at 02:18:31PM +0200, Ard Biesheuvel wrote:
> > > > Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> > > > are clearly ACPI 5.1 based, given that that is the first ACPI revision
> > > > that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> > > > which has a non-zero field on those systems.
> > > > 
> > > > So in these cases, infer from the ARM boot flags that the FADT must be
> > > > 5.1 or later, and treat it as 5.1.
> > > > 
> > > 
> > > Makes sense and looks simple to me.
> > > 
> > > Acked-by: Sudeep Holla <sudeep.holla@arm.com>
> > 
> > Could we pleeeeease have this in for v5.3?
> > 
> > We have available, consumer-level platforms that rely on this change.
> 
> But we do not have the kernel infrastructure to support them so
> I am fine with it but urgency is questionable as far as I am
> concerned.

Yes we do.  At least, we will in v5.3.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-19 12:18 [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Ard Biesheuvel
                   ` (3 preceding siblings ...)
  2019-06-20  9:43 ` Lorenzo Pieralisi
@ 2019-06-24  6:39 ` Hanjun Guo
  2019-06-24 14:55 ` Catalin Marinas
  5 siblings, 0 replies; 10+ messages in thread
From: Hanjun Guo @ 2019-06-24  6:39 UTC (permalink / raw)
  To: Ard Biesheuvel, linux-arm-kernel
  Cc: lorenzo.pieralisi, catalin.marinas, will.deacon, leif.lindholm,
	linux-acpi, lee.jones

On 2019/6/19 20:18, Ard Biesheuvel wrote:
> Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> are clearly ACPI 5.1 based, given that that is the first ACPI revision
> that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> which has a non-zero field on those systems.
> 
> So in these cases, infer from the ARM boot flags that the FADT must be
> 5.1 or later, and treat it as 5.1.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/arm64/kernel/acpi.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 803f0494dd3e..7722e85fb69c 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -155,10 +155,14 @@ static int __init acpi_fadt_sanity_check(void)
>  	 */
>  	if (table->revision < 5 ||
>  	   (table->revision == 5 && fadt->minor_revision < 1)) {
> -		pr_err("Unsupported FADT revision %d.%d, should be 5.1+\n",
> +		pr_err(FW_BUG "Unsupported FADT revision %d.%d, should be 5.1+\n",
>  		       table->revision, fadt->minor_revision);
> -		ret = -EINVAL;
> -		goto out;
> +
> +		if (!fadt->arm_boot_flags) {
> +			ret = -EINVAL;
> +			goto out;
> +		}
> +		pr_err("FADT has ARM boot flags set, assuming 5.1\n");

Obviously it's a firmware bug, but should be harmless,

Acked-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun


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

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

* Re: [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0
  2019-06-19 12:18 [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Ard Biesheuvel
                   ` (4 preceding siblings ...)
  2019-06-24  6:39 ` Hanjun Guo
@ 2019-06-24 14:55 ` Catalin Marinas
  5 siblings, 0 replies; 10+ messages in thread
From: Catalin Marinas @ 2019-06-24 14:55 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: lorenzo.pieralisi, will.deacon, leif.lindholm, linux-acpi,
	lee.jones, linux-arm-kernel

On Wed, Jun 19, 2019 at 02:18:31PM +0200, Ard Biesheuvel wrote:
> Some Qualcomm Snapdragon based laptops built to run Microsoft Windows
> are clearly ACPI 5.1 based, given that that is the first ACPI revision
> that supports ARM, and introduced the FADT 'arm_boot_flags' field,
> which has a non-zero field on those systems.
> 
> So in these cases, infer from the ARM boot flags that the FADT must be
> 5.1 or later, and treat it as 5.1.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Queued for 5.3. Thanks.

-- 
Catalin

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

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

end of thread, other threads:[~2019-06-24 14:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 12:18 [RFC PATCH] acpi/arm64: ignore 5.1 FADTs that are reported as 5.0 Ard Biesheuvel
2019-06-19 12:24 ` Sudeep Holla
2019-06-20  7:57   ` Lee Jones
2019-06-20  9:49     ` Lorenzo Pieralisi
2019-06-20 12:25       ` Lee Jones
2019-06-19 12:26 ` Lee Jones
2019-06-20  7:53 ` Graeme Gregory
2019-06-20  9:43 ` Lorenzo Pieralisi
2019-06-24  6:39 ` Hanjun Guo
2019-06-24 14:55 ` Catalin Marinas

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