SUPERH platform development
 help / color / mirror / Atom feed
* Re: [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW
       [not found] ` <20260506121606.5805-4-john.ogness@linutronix.de>
@ 2026-05-06 12:39   ` Geert Uytterhoeven
  2026-05-06 12:50     ` Geert Uytterhoeven
  2026-05-06 12:53     ` John Ogness
  0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2026-05-06 12:39 UTC (permalink / raw)
  To: John Ogness
  Cc: Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko, linux-kernel,
	Biju Das, Lad Prabhakar, Thierry Bultel, linux-serial,
	Linux-sh list

Hi John,

On Wed, 6 May 2026 at 14:16, John Ogness <john.ogness@linutronix.de> 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@linutronix.de>

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@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW
  2026-05-06 12:39   ` [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW Geert Uytterhoeven
@ 2026-05-06 12:50     ` Geert Uytterhoeven
  2026-05-06 12:53     ` John Ogness
  1 sibling, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2026-05-06 12:50 UTC (permalink / raw)
  To: John Ogness
  Cc: Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko, linux-kernel,
	Biju Das, Lad Prabhakar, Thierry Bultel, linux-serial,
	Linux-sh list

On Wed, 6 May 2026 at 14:39, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Wed, 6 May 2026 at 14:16, John Ogness <john.ogness@linutronix.de> 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@linutronix.de>
>
> 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/20260506124643.128021-1-geert+renesas@glider.be/

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 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW
  2026-05-06 12:39   ` [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW Geert Uytterhoeven
  2026-05-06 12:50     ` Geert Uytterhoeven
@ 2026-05-06 12:53     ` John Ogness
  2026-05-11 15:00       ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: John Ogness @ 2026-05-06 12:53 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko, linux-kernel,
	Biju Das, Lad Prabhakar, Thierry Bultel, linux-serial,
	Linux-sh list

Hi Geert,

On 2026-05-06, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> --- 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.

If there is a v5, I will drop this patch. If v4 is acceptable, the
maintainer can just drop this patch.

I will leave the plat_sci_port.flags removal as an excercise for the sh
folks.

Thanks for your feedback.

John

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW
  2026-05-06 12:53     ` John Ogness
@ 2026-05-11 15:00       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-05-11 15:00 UTC (permalink / raw)
  To: John Ogness
  Cc: Geert Uytterhoeven, Jiri Slaby, Andy Shevchenko, linux-kernel,
	Biju Das, Lad Prabhakar, Thierry Bultel, linux-serial,
	Linux-sh list

On Wed, May 06, 2026 at 02:59:02PM +0206, John Ogness wrote:
> Hi Geert,
> 
> On 2026-05-06, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> >> --- 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.
> 
> If there is a v5, I will drop this patch. If v4 is acceptable, the
> maintainer can just drop this patch.
> 
> I will leave the plat_sci_port.flags removal as an excercise for the sh
> folks.

Ah, this is what confused me.  I've taken the first two patches here,
can you respin the rest on my branch and resend them?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-11 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260506121606.5805-1-john.ogness@linutronix.de>
     [not found] ` <20260506121606.5805-4-john.ogness@linutronix.de>
2026-05-06 12:39   ` [PATCH tty v4 3/6] serial: sh-sci: Avoid deprecated UPF_CONS_FLOW Geert Uytterhoeven
2026-05-06 12:50     ` Geert Uytterhoeven
2026-05-06 12:53     ` John Ogness
2026-05-11 15:00       ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox