Re: [PATCH] ACPI: SPCR: Support UART clock frequency field

From: Markus Probst

Date: Sat May 09 2026 - 04:47:33 EST


On Sat, 2026-05-09 at 08:13 +0200, Markus Probst wrote:
> On Fri, 2026-05-08 at 21:19 +0200, Rafael J. Wysocki wrote:
> > On Tue, May 5, 2026 at 9:36 PM Markus Probst <markus.probst@xxxxxxxxx> wrote:
> > >
> > > The Microsoft Serial Port Console Redirection (SPCR) specification
> > > revision 1.08 comprises additional field: UART Clock Frequency [1].
> > >
> > > It contains a non-zero value indicating the UART clock frequency in Hz.
> > >
> > > Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table [1]
> > > Signed-off-by: Markus Probst <markus.probst@xxxxxxxxx>
> > > ---
> > > drivers/acpi/spcr.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
> > > index 73cb933fdc89..d80ad87efae0 100644
> > > --- a/drivers/acpi/spcr.c
> > > +++ b/drivers/acpi/spcr.c
> > > @@ -220,6 +220,9 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
> > > if (!baud_rate) {
> > > snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
> > > table->serial_port.address);
> > > + } else if (table->header.revision >= 3 && table->uart_clk_freq) {
> > > + snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d,%u", uart, iotype,
> > > + table->serial_port.address, baud_rate, table->uart_clk_freq);
> > > } else {
> > > snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
> > > table->serial_port.address, baud_rate);
> > >
> > > ---
> >
> > Please have a look at the sashiko.dev feedback at
> >
> > https://sashiko.dev/#/patchset/20260505-acpi_spcr-v1-1-fd4bc6f4eb53%40posteo.de
> >
> > and let me know what you think.
> For the first comment, I don't think thats an issue, as there is no
> length check for the other fields either.
>
>
> The second comment however seems true.
>
> while earlycon parses
>
> <baudrate>,<uartclk>
>
> regular uart parses
>
> <baudrate><parity><bits><flow>
>
> This is strange, because according to kernel documentation, options for
> uart should be identical for earlycon and console kernel parameters.
> [1] [2].
I might have misinterpreted the documentation here. That uartclk only
existing on earlycon seems to be intended. Feel free to ignore the last
paragraph of my reply.

Thanks
- Markus Probst

Attachment: signature.asc
Description: This is a digitally signed message part