From: Flavio Suligoi <f.suligoi@asem.it>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>,
"Gustavo A . R . Silva" <gustavoars@kernel.org>,
Ji-Ze Hong <hpeter@gmail.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: R: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
Date: Tue, 15 Dec 2020 14:06:09 +0000 [thread overview]
Message-ID: <178bf34c76184d39b6b17d5e54133821@asem.it> (raw)
In-Reply-To: <X9i9RKAbpoR0F7Y+@kroah.com>
Hi Greg,
> > > > + chip_name = "F81216H";
> > > > + break;
> > > > case CHIP_ID_F81216:
> > > > + chip_name = "F81216";
> > > > break;
> > > > default:
> > > > return -ENODEV;
> > > > }
> > > >
> > > > pdata->pid = chip;
> > > > +
> > > > + pr_info("%s%s%s Fintek %s\n",
> > > > + uart->port.dev ? dev_name(uart->port.dev) : "",
> > > > + uart->port.dev ? ": " : "",
> > > > + uart->port.name,
> > > > + chip_name);
> > >
> > > Drivers, if all goes well, should not print anything to the kernel
> log.
> > > This isn't ok.
> > >
> > > And even if it was, dev_info() would be the correct thing to do...
> >
> > Ok, too many information in the driver.
> >
> > But what do you think about the possibility to introduce
> > a new additional field, in "serial8250_config" structure,
> > such as "extra_name" or something like this:
> >
> > struct serial8250_config {
> > const char *name;
> > const char *extra_name;
> > unsigned short fifo_size;
> > unsigned short tx_loadsz;
> > unsigned char fcr;
> > unsigned char rxtrig_bytes[UART_FCR_R_TRIG_MAX_STATE];
> > unsigned int flags;
> > };
> >
> > In this way, if required, each driver can fill this
> > additional field, for example adding the name of
> > the particular uart chip or other useful info.
> >
> > As result, for example, the "uart_report_port" function output
> > could be something like this:
> >
> > 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A -
> Fintek F81216AD
> > 00:02: ttyS3 at I/O 0x2e8 (irq = 11, base_baud = 115200) is a 16550A -
> Fintek F81216AD
> >
> > where the "extra_name", if not empty, is printed
> > at the end of the line.
> > For practical space reasons, the "extra_name" length
> > can be limited to 16 chars.
>
> Why? What tool will use this, and why would userspace care about it?
>
> What problem are you trying to solve here?
I try to explain my requirement:
we produce some x86 boards with multistandard RS232/422/485 ports
and, to have this feature, in some of these boards, we use a
Fintek uart or superIO.
So this additional info "extra_name" can be useful for
a quick check if the serial ports are multistandard or not,
without any other investigations, but using only a simple command
like:
dmesg| grep ttyS
>
> thanks,
>
> greg k-h
Thanks and best regards,
Flavio
next prev parent reply other threads:[~2020-12-15 14:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-14 13:14 Flavio Suligoi
2020-12-14 13:42 ` Greg Kroah-Hartman
2020-12-15 0:29 ` Ji-Ze Hong (Peter Hong)
2020-12-15 6:30 ` Jiri Slaby
2020-12-15 13:35 ` R: " Flavio Suligoi
2020-12-15 13:42 ` Greg Kroah-Hartman
2020-12-15 14:06 ` Flavio Suligoi [this message]
2020-12-15 14:38 ` R: " Greg Kroah-Hartman
2020-12-15 15:06 ` R: " Flavio Suligoi
2020-12-16 0:53 ` Ji-Ze Hong (Peter Hong)
2020-12-16 9:44 ` R: " Flavio Suligoi
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=178bf34c76184d39b6b17d5e54133821@asem.it \
--to=f.suligoi@asem.it \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=hpeter@gmail.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.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
all inboxes | Powered by JetHome®