[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <551bafb9-4a85-9339-8af3-ad0a4d267491@huawei.com>
Date: Thu, 19 Jun 2025 22:54:13 +0800
From: Hanjun Guo <guohanjun@...wei.com>
To: Li Chen <me@...ux.beauty>, Catalin Marinas <catalin.marinas@....com>, Will
Deacon <will@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown
<lenb@...nel.org>, Liu Wei <liuwei09@...tc.cn>, Ryan Roberts
<ryan.roberts@....com>, Andrew Morton <akpm@...ux-foundation.org>, Jonathan
Cameron <Jonathan.Cameron@...wei.com>, Li Chen <chenl311@...natelecom.cn>,
Sudeep Holla <sudeep.holla@....com>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH 2/2] ACPI: Suppress misleading SPCR console message when
SPCR table is absent
Hi Li Chen,
On 2025/6/6 15:27, Li Chen wrote:
> From: Li Chen<chenl311@...natelecom.cn>
>
> The kernel currently 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 message is only printed if
> acpi_parse_spcr() succeeds (i.e., if the SPCR table
> is present and parsed). This avoids user confusion
> on SPCR-less systems.
>
> Signed-off-by: Li Chen<chenl311@...natelecom.cn>
> ---
> arch/arm64/kernel/acpi.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index b9a66fc146c9f..bf29e7b668f1d 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -197,6 +197,8 @@ static int __init acpi_fadt_sanity_check(void)
> */
> 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,11 @@ void __init acpi_boot_table_init(void)
> * 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)
> + pr_info("Use ACPI SPCR as default console: %s\n",
> + param_acpi_nospcr ? "No" : "Yes");
Print "No" for:
- CONFIG_ACPI_SPCR_TABLE is disabled
- ret != 0
- param_acpi_nospcr = 1
Only print "Yes" for ret = 0.
Thanks
Hanjun
Powered by blists - more mailing lists