mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/acpi: Add acpi=spcr to use SPCR-provided default console
@ 2025-12-28  9:22 Shenghao Yang
  2026-01-14 15:46 ` Borislav Petkov
  0 siblings, 1 reply; 5+ messages in thread
From: Shenghao Yang @ 2025-12-28  9:22 UTC (permalink / raw)
  To: x86
  Cc: Jonathan Corbet, Rafael J. Wysocki, Len Brown, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	linux-doc, linux-kernel, linux-acpi, Shenghao Yang

Commit 0231d00082f6 ("ACPI: SPCR: Make SPCR available to x86")
made SPCR available as an earlycon option on x86 but did not add
it as a preferred console to avoid breaking existing setups -
users have to round trip the dumped console options
("SPCR: console: uart,io,0x3f8,115200") back via their
bootloader.

Let users opt in so serial console configuration can be made
automatic.

Signed-off-by: Shenghao Yang <me@shenghaoyang.info>
---
 Documentation/admin-guide/kernel-parameters.txt | 2 ++
 arch/x86/kernel/acpi/boot.c                     | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index a8d0afde7f85..f9c5b6e4eda9 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -125,6 +125,8 @@ Kernel parameters
 			may result in duplicate corrected error reports.
 			nospcr -- disable console in ACPI SPCR table as
 				default _serial_ console on ARM64
+			spcr -- enable console in ACPI SPCR table as
+				default _serial_ console on X86
 			For ARM64, ONLY "acpi=off", "acpi=on", "acpi=force" or
 			"acpi=nospcr" are available
 			For RISCV64, ONLY "acpi=off", "acpi=on" or "acpi=force"
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 9fa321a95eb3..83bbfa1d6f1f 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -47,6 +47,7 @@ EXPORT_SYMBOL(acpi_disabled);
 
 int acpi_noirq;				/* skip ACPI IRQ initialization */
 static int acpi_nobgrt;			/* skip ACPI BGRT */
+static int acpi_spcr_add __initdata;		/* add SPCR-provided console */
 int acpi_pci_disabled;		/* skip ACPI PCI scan and IRQ initialization */
 EXPORT_SYMBOL(acpi_pci_disabled);
 
@@ -1666,7 +1667,7 @@ int __init acpi_boot_init(void)
 		x86_init.pci.init = pci_acpi_init;
 
 	/* Do not enable ACPI SPCR console by default */
-	acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
+	acpi_parse_spcr(earlycon_acpi_spcr_enable, acpi_spcr_add);
 	return 0;
 }
 
@@ -1703,6 +1704,10 @@ static int __init parse_acpi(char *arg)
 	/* "acpi=nocmcff" disables FF mode for corrected errors */
 	else if (strcmp(arg, "nocmcff") == 0) {
 		acpi_disable_cmcff = 1;
+	}
+	/* "acpi=spcr" adds the SPCR-provided console as a preferred one */
+	else if (strcmp(arg, "spcr") == 0) {
+		acpi_spcr_add = 1;
 	} else {
 		/* Core will printk when we return error. */
 		return -EINVAL;
-- 
2.52.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-17  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-28  9:22 [PATCH] x86/acpi: Add acpi=spcr to use SPCR-provided default console Shenghao Yang
2026-01-14 15:46 ` Borislav Petkov
2026-01-14 17:09   ` Shenghao Yang
2026-01-15 12:00     ` Borislav Petkov
2026-01-17  7:06       ` Shenghao Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®