RE: [PATCH v4 02/16] serial: sh-sci: Add sci_is_fifo_type()

From: Biju Das
Date: Wed Nov 26 2025 - 03:30:16 EST


Hi Geert Uytterhoeven,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: 26 November 2025 08:00
> Subject: Re: [PATCH v4 02/16] serial: sh-sci: Add sci_is_fifo_type()
>
> Hi Biju,
>
> On Tue, 25 Nov 2025 at 16:06, Biju <biju.das.au@xxxxxxxxx> wrote:
> > From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> >
> > Add sci_is_fifo_type() helper for SCI operates in FIFO mode to
> > simplify the code in probe() and remove().
> >
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
>
> Thanks for your patch!
>
> > --- a/drivers/tty/serial/sh-sci.c
> > +++ b/drivers/tty/serial/sh-sci.c
> > @@ -3546,6 +3546,12 @@ static struct uart_driver sci_uart_driver = {
> > .cons = SCI_CONSOLE,
> > };
> >
> > +static bool sci_is_fifo_type(u8 type)
>
> sci_has_fifo?

OK.

>
> > +{
> > + return (type == PORT_SCIFA || type == PORT_SCIFB ||
> > + type == PORT_HSCIF || type == SCI_PORT_RSCI); }
> > +
> > static void sci_remove(struct platform_device *dev) {
> > struct sci_port *s = platform_get_drvdata(dev); @@ -3556,8
> > +3562,7 @@ static void sci_remove(struct platform_device *dev)
> >
> > if (s->port.fifosize > 1)
> > device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger);
> > - if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF ||
> > - type == SCI_PORT_RSCI)
> > + if (sci_is_fifo_type(type))
> > device_remove_file(&dev->dev,
> > &dev_attr_rx_fifo_timeout);
>
> I am wondering if we could just check for s->port.fifosize > 1 instead, and thus combine with the
> above check? We do have to fill in .set_rtg = rsci_scif_set_rtrg first, but are there other hurdles
> to take?


The SCIFA interface on RZ/G2L use PORT_SCIF, so these device files are not populated on those SoCs.
By adding check for s->port.fifosize > 1 it will be taken care.


Cheers,
Biju