linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "József Horváth" <info@ministro.hu>
To: 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>
Cc: 'Rob Herring' <robh+dt@kernel.org>,
	'Jiri Slaby' <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 1/2] Serial: silabs si4455 serial driver
Date: Tue, 12 Jan 2021 17:46:13 +0000	[thread overview]
Message-ID: <20210112174613.GA8782@dev> (raw)
In-Reply-To: <X/3KnP3S4siAxTfG@kroah.com>

On Tue, Jan 12, 2021 at 05:13:16PM +0100, 'Greg Kroah-Hartman' wrote:
> On Tue, Jan 12, 2021 at 03:43:22PM +0000, József Horváth wrote:
> > On Tue, Jan 12, 2021 at 11:28:08AM +0100, 'Greg Kroah-Hartman' wrote:
> > > On Tue, Jan 12, 2021 at 10:18:33AM +0000, Jozsef Horvath wrote:
> > > > --- a/include/uapi/linux/serial_core.h
> > > > +++ b/include/uapi/linux/serial_core.h
> > > > @@ -279,4 +279,7 @@
> > > >  /* Freescale LINFlexD UART */
> > > >  #define PORT_LINFLEXUART	122
> > > >  
> > > > +/* Silicon Labs SI4455 */
> > > > +#define PORT_SI4455     123
> > > 
> > > What userspace tool is going to need this value?
> > 
> > The PORT_SI4455 is defined for using as port type value in struct uart_port.
> > I checked other serial drivers under drivers/tty/serial and the port types
> > used by serial drivers are defined in two places:
> > 
> > include/uapi/linux/serial_core.h
> > include/uapi/linux/serial.h
> > 
> > The port type is required by serial_core, and its value goes back to
> > user space with TIOCGSERIAL ioctl call.
> 
> What is it required for?  Who uses this?
> 
> > I can't set port type value to 0(PORT_UNKNOWN).
> 
> Why not?

In drivers/tty/serial/serial_core.c
1784:	uart_port_activate(...)
1799:		->	uart_startup(...)
260:			->	uart_port_startup(...)

183:	static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
184:			int init_hw)
...
191:		if (uport->type == PORT_UNKNOWN)
192:			return 1;
...
221:		retval = uport->ops->startup(uport);	<--This is the reason. The drivers
 startup function is not get called if type==PORT_UNKNOWN
...

> 
> > I think my drivers source is not the best place to defining PORT_SI4455,
> >  but I can't find better place then include/uapi/linux/serial_core.h
> > 
> > Could you please help me where is the correct location for this definition?
> 
> I ask as I am trying to figure out why we keep adding these ids, yet no
> tool that i know of seems to actually use them.
> 
> If you don't have a tool that needs to use a new id, then I would
> recommend not adding it, right?

This definition is not my requirement, but I would avoid collision with other
 drivers port type value.
At this point as I understand your words, these definitions will be obsolete
 or optional soon and I can choose any value for drivers port type.

Right?

I would ask you about dev name (ttySSi).
Is it okay?

I didnt find any similar.

> 
> thanks,
> 
> greg k-h

Üdvözlettel / Best regards:
József Horváth


      reply	other threads:[~2021-01-12 17:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 10:18 [PATCH v8 1/2] Serial: silabs si4455 serial driver Jozsef Horvath
2021-01-12 10:28 ` 'Greg Kroah-Hartman'
2021-01-12 15:43   ` József Horváth
2021-01-12 16:13     ` 'Greg Kroah-Hartman'
2021-01-12 17:46       ` József Horváth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210112174613.GA8782@dev \
    --to=info@ministro.hu \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).