Re: [PATCH v3 1/2] serial: earlycon: add uart_clk_freq parameter

From: Markus Probst

Date: Sun Jul 12 2026 - 12:36:36 EST


On Fri, 2026-07-10 at 14:36 +0200, Greg Kroah-Hartman wrote:
> On Mon, Jun 15, 2026 at 12:40:21AM +0000, Markus Probst wrote:
> > Add function `setup_earlycon_with_uartclk`. This allows the
> > options string to be reused with `add_preferred_console`, while still
> > allowing to set the uart clock frequency. This will be used in the
> > following commit ("ACPI: SPCR: Support UART clock frequency field").
> >
> > No logical change intended.
> >
> > Signed-off-by: Markus Probst <markus.probst@xxxxxxxxx>
> > ---
> > drivers/tty/serial/earlycon.c | 17 ++++++++++++-----
> > include/linux/serial_core.h | 11 +++++++++--
> > 2 files changed, 21 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
> > index ab9af37f6cda..5a20fe9e3fb6 100644
> > --- a/drivers/tty/serial/earlycon.c
> > +++ b/drivers/tty/serial/earlycon.c
> > @@ -135,11 +135,14 @@ static int __init parse_options(struct earlycon_device *device, char *options)
> > return 0;
> > }
> >
> > -static int __init register_earlycon(char *buf, const struct earlycon_id *match)
> > +static int __init register_earlycon(char *buf, unsigned int uart_clk_freq,
> > + const struct earlycon_id *match)
> > {
> > int err;
> > struct uart_port *port = &early_console_dev.port;
> >
> > + port->uartclk = uart_clk_freq;
>
> This looks like a logical change, the code today does not do that
> anywhere, right?

`register_earlycon` only gets executed once.
Thus early_console_dev.port->uartclk is always 0.
Since all current callers in this patch series use `setup_earlycon`,
the uart_clk_freq parameter is also always 0.

So in case of behaviour/logic, this line does nothing without the 2.
patch.

Thanks
- Markus Probst

>
> thanks,
>
> greg k-h

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