]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPI: Suppress misleading SPCR console message when SPCR table is absent
authorLi Chen <chenl311@chinatelecom.cn>
Fri, 20 Jun 2025 13:13:08 +0000 (21:13 +0800)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 1 Jul 2025 14:06:51 +0000 (15:06 +0100)
The kernel currently alway prints:
"Use ACPI SPCR as default console: No/Yes "

even on systems that lack an SPCR table. This can
mislead users into thinking the SPCR table exists
on the machines without SPCR.

With this change, the "Yes" is only printed if
the SPCR table is present, parsed and !param_acpi_nospcr.
This avoids user confusion on SPCR-less systems.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Acked-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://lore.kernel.org/r/20250620131309.126555-3-me@linux.beauty
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/acpi.c

index b9a66fc146c9fa66a85ebc4247fcdf0d15dba761..4d529ff7ba513a5b422fedef5720cdb80829e547 100644 (file)
@@ -197,6 +197,8 @@ out:
  */
 void __init acpi_boot_table_init(void)
 {
+       int ret;
+
        /*
         * Enable ACPI instead of device tree unless
         * - ACPI has been disabled explicitly (acpi=off), or
@@ -250,10 +252,12 @@ done:
                 * behaviour, use acpi=nospcr to disable console in ACPI SPCR
                 * table as default serial console.
                 */
-               acpi_parse_spcr(earlycon_acpi_spcr_enable,
+               ret = acpi_parse_spcr(earlycon_acpi_spcr_enable,
                        !param_acpi_nospcr);
-               pr_info("Use ACPI SPCR as default console: %s\n",
-                               param_acpi_nospcr ? "No" : "Yes");
+               if (!ret || param_acpi_nospcr || !IS_ENABLED(CONFIG_ACPI_SPCR_TABLE))
+                       pr_info("Use ACPI SPCR as default console: No\n");
+               else
+                       pr_info("Use ACPI SPCR as default console: Yes\n");
 
                if (IS_ENABLED(CONFIG_ACPI_BGRT))
                        acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);