linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] serial: 8250_fintek: Print Fintek chip name
@ 2020-12-14 13:14 Flavio Suligoi
  2020-12-14 13:42 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 11+ messages in thread
From: Flavio Suligoi @ 2020-12-14 13:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Gustavo A . R . Silva, Ji-Ze Hong
  Cc: linux-serial, linux-kernel, Flavio Suligoi

At the moment, if a Fintek UART is detected, there is no
printed information about this.
The ttyS port is declared as a simple 16550A port, but,
especially when we want to use the RS485 mode, it's
very important understand if the Fintek UART is correctly
detected as expected.

Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
---
 drivers/tty/serial/8250/8250_fintek.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c
index 31c9e83ea3cb..ef2303cb5176 100644
--- a/drivers/tty/serial/8250/8250_fintek.c
+++ b/drivers/tty/serial/8250/8250_fintek.c
@@ -97,6 +97,7 @@ struct fintek_8250 {
 	u16 base_port;
 	u8 index;
 	u8 key;
+	const char *chip_name;
 };
 
 static u8 sio_read_reg(struct fintek_8250 *pdata, u8 reg)
@@ -140,9 +141,11 @@ static void fintek_8250_exit_key(u16 base_port)
 	release_region(base_port + ADDR_PORT, 2);
 }
 
-static int fintek_8250_check_id(struct fintek_8250 *pdata)
+static int fintek_8250_check_id(struct fintek_8250 *pdata,
+				struct uart_8250_port *uart)
 {
 	u16 chip;
+	const char *chip_name;
 
 	if (sio_read_reg(pdata, VENDOR_ID1) != VENDOR_ID1_VAL)
 		return -ENODEV;
@@ -155,17 +158,35 @@ static int fintek_8250_check_id(struct fintek_8250 *pdata)
 
 	switch (chip) {
 	case CHIP_ID_F81865:
+		chip_name = "F81865";
+		break;
 	case CHIP_ID_F81866:
+		chip_name = "F81866";
+		break;
 	case CHIP_ID_F81966:
+		chip_name = "F81966";
+		break;
 	case CHIP_ID_F81216AD:
+		chip_name = "F81216AD";
+		break;
 	case CHIP_ID_F81216H:
+		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);
+
 	return 0;
 }
 
@@ -406,7 +427,7 @@ static int probe_setup_port(struct fintek_8250 *pdata,
 
 			if (fintek_8250_enter_key(addr[i], keys[j]))
 				continue;
-			if (fintek_8250_check_id(pdata) ||
+			if (fintek_8250_check_id(pdata, uart) ||
 			    fintek_8250_get_ldn_range(pdata, &min, &max)) {
 				fintek_8250_exit_key(addr[i]);
 				continue;
-- 
2.25.1


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

* Re: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-14 13:14 [PATCH v1] serial: 8250_fintek: Print Fintek chip name Flavio Suligoi
@ 2020-12-14 13:42 ` Greg Kroah-Hartman
  2020-12-15  0:29   ` Ji-Ze Hong (Peter Hong)
  2020-12-15 13:35   ` R: " Flavio Suligoi
  0 siblings, 2 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2020-12-14 13:42 UTC (permalink / raw)
  To: Flavio Suligoi
  Cc: Jiri Slaby, Gustavo A . R . Silva, Ji-Ze Hong, linux-serial,
	linux-kernel

On Mon, Dec 14, 2020 at 02:14:45PM +0100, Flavio Suligoi wrote:
> At the moment, if a Fintek UART is detected, there is no
> printed information about this.
> The ttyS port is declared as a simple 16550A port, but,
> especially when we want to use the RS485 mode, it's
> very important understand if the Fintek UART is correctly
> detected as expected.
> 
> Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
> ---
>  drivers/tty/serial/8250/8250_fintek.c | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c
> index 31c9e83ea3cb..ef2303cb5176 100644
> --- a/drivers/tty/serial/8250/8250_fintek.c
> +++ b/drivers/tty/serial/8250/8250_fintek.c
> @@ -97,6 +97,7 @@ struct fintek_8250 {
>  	u16 base_port;
>  	u8 index;
>  	u8 key;
> +	const char *chip_name;
>  };
>  
>  static u8 sio_read_reg(struct fintek_8250 *pdata, u8 reg)
> @@ -140,9 +141,11 @@ static void fintek_8250_exit_key(u16 base_port)
>  	release_region(base_port + ADDR_PORT, 2);
>  }
>  
> -static int fintek_8250_check_id(struct fintek_8250 *pdata)
> +static int fintek_8250_check_id(struct fintek_8250 *pdata,
> +				struct uart_8250_port *uart)
>  {
>  	u16 chip;
> +	const char *chip_name;
>  
>  	if (sio_read_reg(pdata, VENDOR_ID1) != VENDOR_ID1_VAL)
>  		return -ENODEV;
> @@ -155,17 +158,35 @@ static int fintek_8250_check_id(struct fintek_8250 *pdata)
>  
>  	switch (chip) {
>  	case CHIP_ID_F81865:
> +		chip_name = "F81865";
> +		break;
>  	case CHIP_ID_F81866:
> +		chip_name = "F81866";
> +		break;
>  	case CHIP_ID_F81966:
> +		chip_name = "F81966";
> +		break;
>  	case CHIP_ID_F81216AD:
> +		chip_name = "F81216AD";
> +		break;
>  	case CHIP_ID_F81216H:
> +		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...

thanks,

greg k-h

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

* Re: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  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
  1 sibling, 1 reply; 11+ messages in thread
From: Ji-Ze Hong (Peter Hong) @ 2020-12-15  0:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Flavio Suligoi
  Cc: Jiri Slaby, Gustavo A . R . Silva, linux-serial, linux-kernel

Hi,

Greg Kroah-Hartman 於 2020/12/14 下午 09:42 寫道:
>>   	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...

Maybe can transform pr_info() to dev_dbg() for debug usage ?

-- 
With Best Regards,
Peter Hong

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

* Re: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-15  0:29   ` Ji-Ze Hong (Peter Hong)
@ 2020-12-15  6:30     ` Jiri Slaby
  0 siblings, 0 replies; 11+ messages in thread
From: Jiri Slaby @ 2020-12-15  6:30 UTC (permalink / raw)
  To: Ji-Ze Hong (Peter Hong), Greg Kroah-Hartman, Flavio Suligoi
  Cc: Gustavo A . R . Silva, linux-serial, linux-kernel

On 15. 12. 20, 1:29, Ji-Ze Hong (Peter Hong) wrote:
> Hi,
> 
> Greg Kroah-Hartman 於 2020/12/14 下午 09:42 寫道:
>>>       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...
> 
> Maybe can transform pr_info() to dev_dbg() for debug usage ?

And even then, the newly introduced fintek_8250.chip_name is unused.

thanks,
-- 
js

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

* R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-14 13:42 ` Greg Kroah-Hartman
  2020-12-15  0:29   ` Ji-Ze Hong (Peter Hong)
@ 2020-12-15 13:35   ` Flavio Suligoi
  2020-12-15 13:42     ` Greg Kroah-Hartman
  1 sibling, 1 reply; 11+ messages in thread
From: Flavio Suligoi @ 2020-12-15 13:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Gustavo A . R . Silva, Ji-Ze Hong, linux-serial,
	linux-kernel

Hi Greg,

> >
> >  	switch (chip) {
> >  	case CHIP_ID_F81865:
> > +		chip_name = "F81865";
> > +		break;
> >  	case CHIP_ID_F81866:
> > +		chip_name = "F81866";
> > +		break;
> >  	case CHIP_ID_F81966:
> > +		chip_name = "F81966";
> > +		break;
> >  	case CHIP_ID_F81216AD:
> > +		chip_name = "F81216AD";
> > +		break;
> >  	case CHIP_ID_F81216H:
> > +		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.

> 
> thanks,
> 
> greg k-h

Thanks and best regards,

Flavio

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

* Re: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-15 13:35   ` R: " Flavio Suligoi
@ 2020-12-15 13:42     ` Greg Kroah-Hartman
  2020-12-15 14:06       ` R: " Flavio Suligoi
  0 siblings, 1 reply; 11+ messages in thread
From: Greg Kroah-Hartman @ 2020-12-15 13:42 UTC (permalink / raw)
  To: Flavio Suligoi
  Cc: Jiri Slaby, Gustavo A . R . Silva, Ji-Ze Hong, linux-serial,
	linux-kernel

On Tue, Dec 15, 2020 at 01:35:31PM +0000, Flavio Suligoi wrote:
> Hi Greg,
> 
> > >
> > >  	switch (chip) {
> > >  	case CHIP_ID_F81865:
> > > +		chip_name = "F81865";
> > > +		break;
> > >  	case CHIP_ID_F81866:
> > > +		chip_name = "F81866";
> > > +		break;
> > >  	case CHIP_ID_F81966:
> > > +		chip_name = "F81966";
> > > +		break;
> > >  	case CHIP_ID_F81216AD:
> > > +		chip_name = "F81216AD";
> > > +		break;
> > >  	case CHIP_ID_F81216H:
> > > +		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?

thanks,

greg k-h

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

* R: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-15 13:42     ` Greg Kroah-Hartman
@ 2020-12-15 14:06       ` Flavio Suligoi
  2020-12-15 14:38         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 11+ messages in thread
From: Flavio Suligoi @ 2020-12-15 14:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Gustavo A . R . Silva, Ji-Ze Hong, linux-serial,
	linux-kernel

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

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

* Re: R: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-15 14:06       ` R: " Flavio Suligoi
@ 2020-12-15 14:38         ` Greg Kroah-Hartman
  2020-12-15 15:06           ` R: " Flavio Suligoi
  0 siblings, 1 reply; 11+ messages in thread
From: Greg Kroah-Hartman @ 2020-12-15 14:38 UTC (permalink / raw)
  To: Flavio Suligoi
  Cc: Jiri Slaby, Gustavo A . R . Silva, Ji-Ze Hong, linux-serial,
	linux-kernel

On Tue, Dec 15, 2020 at 02:06:09PM +0000, Flavio Suligoi wrote:
> 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

But as they work the same, why does it matter?

Userspace should not care here.  Isn't there some other id you can
read/query for a hardware database tool to determine this?

Printing a random string to the kernel log is not a good way to do
hardware descriptions in a format that everyone can easily parse them :)

thanks,

greg k-h

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

* R: R: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-15 14:38         ` Greg Kroah-Hartman
@ 2020-12-15 15:06           ` Flavio Suligoi
  2020-12-16  0:53             ` Ji-Ze Hong (Peter Hong)
  0 siblings, 1 reply; 11+ messages in thread
From: Flavio Suligoi @ 2020-12-15 15:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Gustavo A . R . Silva, Ji-Ze Hong, linux-serial,
	linux-kernel

Hi Greg,

> > > 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
> 
> But as they work the same, why does it matter?

Yes you are right, by the user point of view, they are the same.

> 
> Userspace should not care here.  Isn't there some other id you can
> read/query for a hardware database tool to determine this?

Yes, there is. I can add this info in the BIOS, in SMBIOS table
type 8 for example, or I can read the board name and then
search in a custom database tool what peripherals are present in the board. 

> 
> Printing a random string to the kernel log is not a good way to do
> hardware descriptions in a format that everyone can easily parse them :)

Ok, right! Thanks very much for your time Greg! 😊

> thanks,
> 
> greg k-h

Best regards,
Flavio

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

* Re: R: R: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Ji-Ze Hong (Peter Hong) @ 2020-12-16  0:53 UTC (permalink / raw)
  To: Flavio Suligoi, Greg Kroah-Hartman
  Cc: Jiri Slaby, Gustavo A . R . Silva, linux-serial, linux-kernel

Hi,

Flavio Suligoi 於 2020/12/15 下午 11:06 寫道:
>>> 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
>>
>> But as they work the same, why does it matter?
> 
> Yes you are right, by the user point of view, they are the same.
> 
>>
>> Userspace should not care here.  Isn't there some other id you can
>> read/query for a hardware database tool to determine this?


As Greg mentions, The userspace don't care what IC they are using.
We can use Linux RS485 API to control or check the serial port.

https://www.kernel.org/doc/html/latest/driver-api/serial/serial-rs485.html

-- 
With Best Regards,
Peter Hong

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

* R: R: R: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name
  2020-12-16  0:53             ` Ji-Ze Hong (Peter Hong)
@ 2020-12-16  9:44               ` Flavio Suligoi
  0 siblings, 0 replies; 11+ messages in thread
From: Flavio Suligoi @ 2020-12-16  9:44 UTC (permalink / raw)
  To: Ji-Ze Hong (Peter Hong)
  Cc: Jiri Slaby, Gustavo A . R . Silva, linux-serial, linux-kernel,
	Greg Kroah-Hartman

Hi Peter,

> >>>
> >>> dmesg| grep ttyS
> >>
> >> But as they work the same, why does it matter?
> >
> > Yes you are right, by the user point of view, they are the same.
> >
> >>
> >> Userspace should not care here.  Isn't there some other id you can
> >> read/query for a hardware database tool to determine this?
> 
> 
> As Greg mentions, The userspace don't care what IC they are using.
> We can use Linux RS485 API to control or check the serial port.
> 
> https://www.kernel.org/doc/html/latest/driver-api/serial/serial-rs485.html

Yes, right! 
Thanks for your info!

> 
> --
> With Best Regards,
> Peter Hong

Best regards,
Flavio

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

end of thread, other threads:[~2020-12-16  9:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 13:14 [PATCH v1] serial: 8250_fintek: Print Fintek chip name 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       ` R: " Flavio Suligoi
2020-12-15 14:38         ` 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

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).