Skip to content

Commit bad3fa2

Browse files
FirstLoveLifectmarinas
authored andcommitted
ACPI: Suppress misleading SPCR console message when SPCR table is absent
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 <[email protected]> Acked-by: Hanjun Guo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent b9f58d3 commit bad3fa2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arch/arm64/kernel/acpi.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ static int __init acpi_fadt_sanity_check(void)
197197
*/
198198
void __init acpi_boot_table_init(void)
199199
{
200+
int ret;
201+
200202
/*
201203
* Enable ACPI instead of device tree unless
202204
* - ACPI has been disabled explicitly (acpi=off), or
@@ -250,10 +252,12 @@ void __init acpi_boot_table_init(void)
250252
* behaviour, use acpi=nospcr to disable console in ACPI SPCR
251253
* table as default serial console.
252254
*/
253-
acpi_parse_spcr(earlycon_acpi_spcr_enable,
255+
ret = acpi_parse_spcr(earlycon_acpi_spcr_enable,
254256
!param_acpi_nospcr);
255-
pr_info("Use ACPI SPCR as default console: %s\n",
256-
param_acpi_nospcr ? "No" : "Yes");
257+
if (!ret || param_acpi_nospcr || !IS_ENABLED(CONFIG_ACPI_SPCR_TABLE))
258+
pr_info("Use ACPI SPCR as default console: No\n");
259+
else
260+
pr_info("Use ACPI SPCR as default console: Yes\n");
257261

258262
if (IS_ENABLED(CONFIG_ACPI_BGRT))
259263
acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);

0 commit comments

Comments
 (0)