[PATCH v2 0/2] ACPI: Improve SPCR handling and messaging on SPCR-less systems

Li Chen posted 2 patches 3 months, 2 weeks ago
arch/arm64/kernel/acpi.c | 10 +++++++---
include/linux/acpi.h     |  2 +-
2 files changed, 8 insertions(+), 4 deletions(-)
[PATCH v2 0/2] ACPI: Improve SPCR handling and messaging on SPCR-less systems
Posted by Li Chen 3 months, 2 weeks ago
From: Li Chen <chenl311@chinatelecom.cn>

From: Li Chen <chenl311@chinatelecom.cn>

This small series improves the kernel behavior and output when the ACPI SPCR
table is not present or not supported.

Currently, even on systems that completely lack an SPCR table, the kernel prints:
"Use ACPI SPCR as default console: Yes"

This may mislead users into thinking an SPCR table exists
when in fact there is no such table at all. This series addresses this in two steps:

Patch 1 ensures that acpi_parse_spcr() returns -ENODEV if CONFIG_ACPI_SPCR_TABLE is disabled.

Patch 2 updates arm64 acpi_boot_table_init() to only print the Yes
if acpi_parse_spcr() succeeds.

This results in cleaner and more accurate boot logs on ARM64.

Tested on both SPCR-enabled and SPCR-less qemu-system arm64 virt platform. [1]

Changelog:
v2: refine the printk message logic as suggested by Hanjun Guo. [2]

[1]: https://patchew.org/QEMU/20250528105404.457729-1-me@linux.beauty/
[2]: https://www.spinics.net/lists/kernel/msg5730585.html

Li Chen (2):
  ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is
    disabled
  ACPI: Suppress misleading SPCR console message when SPCR table is
    absent

 arch/arm64/kernel/acpi.c | 10 +++++++---
 include/linux/acpi.h     |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.49.0
Re: [PATCH v2 0/2] ACPI: Improve SPCR handling and messaging on SPCR-less systems
Posted by Catalin Marinas 3 months, 1 week ago
On Fri, 20 Jun 2025 21:13:06 +0800, Li Chen wrote:
> From: Li Chen <chenl311@chinatelecom.cn>
> 
> This small series improves the kernel behavior and output when the ACPI SPCR
> table is not present or not supported.
> 
> Currently, even on systems that completely lack an SPCR table, the kernel prints:
> "Use ACPI SPCR as default console: Yes"
> 
> [...]

Applied to arm64 (for-next/acpi), thanks!

[1/2] ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is disabled
      https://git.kernel.org/arm64/c/b9f58d3572a8
[2/2] ACPI: Suppress misleading SPCR console message when SPCR table is absent
      https://git.kernel.org/arm64/c/bad3fa2fb920

-- 
Catalin
Re: [PATCH v2 0/2] ACPI: Improve SPCR handling and messaging on SPCR-less systems
Posted by Hanjun Guo 3 months, 1 week ago
On 2025/6/20 21:13, Li Chen wrote:
> From: Li Chen <chenl311@chinatelecom.cn>
> This small series improves the kernel behavior and output when the ACPI SPCR
> table is not present or not supported.
> 
> Currently, even on systems that completely lack an SPCR table, the kernel prints:
> "Use ACPI SPCR as default console: Yes"
> 
> This may mislead users into thinking an SPCR table exists
> when in fact there is no such table at all. This series addresses this in two steps:
> 
> Patch 1 ensures that acpi_parse_spcr() returns -ENODEV if CONFIG_ACPI_SPCR_TABLE is disabled.
> 
> Patch 2 updates arm64 acpi_boot_table_init() to only print the Yes
> if acpi_parse_spcr() succeeds.
> 
> This results in cleaner and more accurate boot logs on ARM64.
> 
> Tested on both SPCR-enabled and SPCR-less qemu-system arm64 virt platform. [1]
> 
> Changelog:
> v2: refine the printk message logic as suggested by Hanjun Guo. [2]
> 
> [1]: https://patchew.org/QEMU/20250528105404.457729-1-me@linux.beauty/
> [2]: https://www.spinics.net/lists/kernel/msg5730585.html
> 
> Li Chen (2):
>    ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is
>      disabled
>    ACPI: Suppress misleading SPCR console message when SPCR table is
>      absent
> 
>   arch/arm64/kernel/acpi.c | 10 +++++++---
>   include/linux/acpi.h     |  2 +-
>   2 files changed, 8 insertions(+), 4 deletions(-)

This version looks good to me,

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

Thanks
Hanjun