From: Hanjun Guo <guohanjun@huawei.com>
To: Li Chen <me@linux.beauty>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Liu Wei <liuwei09@cestc.cn>,
Ryan Roberts <ryan.roberts@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Li Chen <chenl311@chinatelecom.cn>,
Sudeep Holla <sudeep.holla@arm.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH 2/2] ACPI: Suppress misleading SPCR console message when SPCR table is absent
Date: Thu, 19 Jun 2025 22:54:13 +0800 [thread overview]
Message-ID: <551bafb9-4a85-9339-8af3-ad0a4d267491@huawei.com> (raw)
In-Reply-To: <20250606072802.191580-3-me@linux.beauty>
Hi Li Chen,
On 2025/6/6 15:27, Li Chen wrote:
> From: Li Chen<chenl311@chinatelecom.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@chinatelecom.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
next prev parent reply other threads:[~2025-06-19 17:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 7:27 [PATCH 0/2] ACPI: Improve SPCR handling and messaging on SPCR-less systems Li Chen
2025-06-06 7:27 ` [PATCH 1/2] ACPI: Return -ENODEV from acpi_parse_spcr() when SPCR support is disabled Li Chen
2025-06-06 7:27 ` [PATCH 2/2] ACPI: Suppress misleading SPCR console message when SPCR table is absent Li Chen
2025-06-19 14:54 ` Hanjun Guo [this message]
2025-06-19 11:49 ` [PATCH 0/2] ACPI: Improve SPCR handling and messaging on SPCR-less systems Li Chen
2025-06-19 14:42 ` Hanjun Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=551bafb9-4a85-9339-8af3-ad0a4d267491@huawei.com \
--to=guohanjun@huawei.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=chenl311@chinatelecom.cn \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuwei09@cestc.cn \
--cc=me@linux.beauty \
--cc=rafael@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=sudeep.holla@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox