Re: [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW
From: Geert Uytterhoeven
Date: Wed May 06 2026 - 08:45:05 EST
Hi John,
On Wed, 6 May 2026 at 14:16, John Ogness <john.ogness@xxxxxxxxxxxxx> wrote:
> Avoid setting the uart_port.flags deprecated UPF_CONS_FLOW bit if it
> has been configured in the platform data. Use the new cons_flow
> wrappers instead.
>
> Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>
Thanks for your patch!
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -3369,9 +3369,12 @@ static int sci_init_single(struct platform_device *dev,
> }
>
> port->type = SCI_PUBLIC_PORT_ID(p->type);
> - port->flags = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF | p->flags;
> + port->flags = UPF_FIXED_PORT | UPF_BOOT_AUTOCONF |
> + (p->flags & ~UPF_CONS_FLOW);
This seems over-cautious to me.
The last setter of p->flags was removed in commit 37744feebc086908
("sh: remove sh5 support") in v5.8. No platform data ever set the
UPF_CONS_FLOW flag before. I would rather remove plat_sci_port.flags
and this "| p->flags", so we don't have to care about UPF_CONS_FLOW
in this driver at all.
> port->fifosize = sci_port->params->fifosize;
>
> + uart_set_cons_flow_enabled(port, p->flags & UPF_CONS_FLOW);
> +
> if (p->type == PORT_SCI && !dev->dev.of_node) {
> if (sci_port->reg_size >= 0x20)
> port->regshift = 2;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds