Re: [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW

Geert Uytterhoeven <[email protected]>
Newsgroups gmane.linux.serial,gmane.linux.kernel,gmane.linux.ports.sh.devel
Message-ID <CAMuHMdWH5eH48JkS7phxhgVxAqC_8x1Z=GSxgAVF-eb5Xnt=yQ@mail.gmail.com>
On Wed, 6 May 2026 at 14:39, Geert Uytterhoeven <[email protected]> wrote:
> On Wed, 6 May 2026 at 14:16, John Ogness <[email protected]> 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 <[email protected]>
>
> 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.

I have sent a patch to remove it:
https://lore.kernel.org/[email protected]/

Builds on Renesas ARM/ARM64/RISCV/SH, and boots on QEMU
(rts7751)r2d.

>
> >         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 -- [email protected]

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
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.