Re: [PATCH v7 10/13] serial: sh-sci: Add support for RZ/T2H SCI
From: Greg KH
Date: Tue Apr 15 2025 - 08:35:57 EST
On Mon, Apr 14, 2025 at 04:07:23PM +0200, Geert Uytterhoeven wrote:
> Hi Greg,
>
> On Mon, 14 Apr 2025 at 11:32, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Mon, Apr 14, 2025 at 11:23:34AM +0200, Thierry Bultel wrote:
> > > Le 14/04/2025 à 10:58, Greg KH a écrit :
> > > > On Mon, Apr 14, 2025 at 07:54:12AM +0000, Thierry Bultel wrote:
> > > > > > From: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
> > > > > On Thu, Apr 03, 2025 at 11:29:12PM +0200, Thierry Bultel wrote:
> > > > > > > --- a/include/uapi/linux/serial_core.h
> > > > > > > +++ b/include/uapi/linux/serial_core.h
> > > > > > > @@ -231,6 +231,9 @@
> > > > > > > /* Sunplus UART */
> > > > > > > #define PORT_SUNPLUS 123
> > > > > > >
> > > > > > > +/* SH-SCI */
> > > > > > > +#define PORT_RSCI 124
> > > > > > Why do you need to tell userspace about this specific port? Is that a
> > > > > > hard requirement that your userspace tools require? If not, please don't
> > > > > > export this here.
> > > > > This point has been discussed with Geert and Wolfram.
> > > > > We cannot use PORT_GENERIC for this IP, and adding the new type
> > > > > is just keeping consistent with the sh-sci driver.
> > > > But, why does userspace need to know this number? And why doesn't
> > > > PORT_GENERIC work?
> > >
> > > The reason is that the sh-sci driver discriminates internally between port
> > > types.
> > > There are number of locations when it checks for PORT_SCI, PORT_SCIF,
> > > PORT_SCIFA...
> >
> > That is internal to the kernel, not external, right?
>
> Indeed.
>
> > > T2H SCI needs special handling, too, that is the reason why PORT_GENERIC
> > > cannot work. I just therefore added this new type.
> >
> > Again, why does userspace need to know this?
>
> I guess userspace does not need to know about this (does userspace
> actually care about any of these values, except for PORT_8250 and
> friends?).
>
> However, traditionally PORT_* has been used as the differentiator
> for serial port types in most drivers in the kernel (incl. sh-sci.c)
> as well. Just two drivers use PORT_GENERIC, and these are the ones
> that came with the introduction of PORT_GENERIC. Since the rsci driver
> is not a new driver, but a sub-driver of the existing sh-sci driver,
> I think it warrants keeping on using the type field, like before. Else
> it will have to become even more complex than it already is.
>
> Note I am fine with using a non-uapi value. Is there a PORT_* number
> range meant for internal (non-uapi) use?
We can just start putting them in a non-uapi file so that we don't have
to keep adding things to userspace that never needs it.
thanks,
greg k-h