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

Markus Probst <[email protected]>
Newsgroups gmane.linux.acpi.devel,gmane.linux.kernel,gmane.linux.serial
Message-ID <[email protected]>
On Sun, 2026-07-12 at 18:40 +0200, Greg Kroah-Hartman wrote:
> On Sun, Jul 12, 2026 at 04:36:17PM +0000, Markus Probst wrote:
> > 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 <[email protected]>
> > > > ---
> > > >  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.
> 
> Then it belongs in the second patch, right?
No.

It does nothing, because the newly added function
`setup_earlycon_with_uartclk` isn't used yet (first caller in the
second patch).

Moving this line in the second patch, would make the
`setup_earlycon_with_uartclk` function obsolete.

Thanks
- Markus Probst

> 
> thanks,
> 
> greg k-h
signature.asc (application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE-----

iQJPBAABCAA5FiEEgnQYxPSsWOdyMMRzNHYf+OetQ9IFAmpTxMcbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJEDR2H/jnrUPSoLkP/RYGwU8eFlT1NyQj3i1d
ayC6lF59Db6oN3AsHEbyM3Bdrflp0r2Jxlf0ikhfyllLtAgKE1YQZaQzT6EA3uUW
vaGxCUTntSAD+obwNmvaaXmaygfrXm87IlX6qq51vEQ5DJB8w7wSzCvVYHtvwj0u
w2BS/f66pTdQfInRHADcgbWid063NCJKMU2/YXdxfhg4sUEQ9WO7c3QnDRQIpKrG
tY5ei5xfYBI32mEHiROcDfah3ivgA0wL9uWeQHpymX2GIPcwNtHKUOFxwwSEDOFS
5+D8tC47Un3JPb51r7ZhSgzjquHhcLRcYMWIgpiIEsWfOYgEWert1XVfZroRmM4a
+FgwdIqdxCiZ7T/iTbhYmFL2fvXAkU3rn3OkFtKGRx5n5i07243LLa1PWXDjxZJA
KvIp6LaXevxhb0W2uLYBEvH+ljXdTmc5YIx6EBp33bjdFaIBWCdiU6r6cCSuqrzj
exPcKiP6zdv0jccI1Vau/b35HOPpneXU02FN8HR2IMlhXapoXiTy/Z1OLCVgnwzN
+JokUWSoqVx7FupAAzxCBJS7E2dYXJnKgn6hyCCOVNzkBERokWPD+7qxUvpW8tDW
3/wg4iGHJYRCmoM1Holbr/dM0JzOY9sv4h1Wg9EFjlOPsK7vTcsRAX8e1HxRWxnw
muCtwZIdUbbR4BJD8FY5di0H
=Bw27
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.