diff mbox series

[3/3] serial: 8250: remove UART_CAP_TEMT on PORT_16550A_FSL64

Message ID 20210128233629.4164-4-etremblay@distech-controls.com
State New
Headers show
Series Handle UART without interrupt on TEMT using em485 | expand

Commit Message

Eric Tremblay Jan. 28, 2021, 11:36 p.m. UTC
That port does not have an interrupt on TEMT when using
the FIFO mode.

Signed-off-by: Eric Tremblay <etremblay@distech-controls.com>
---
 drivers/tty/serial/8250/8250_of.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Eric Tremblay Jan. 29, 2021, 6:04 p.m. UTC | #1
On 2021-01-29 6:25 a.m., Andy Shevchenko wrote:
> On Thu, Jan 28, 2021 at 06:36:29PM -0500, Eric Tremblay wrote:

>> That port does not have an interrupt on TEMT when using

>> the FIFO mode.

> This is wrong.

> 1. You have to guarantee that TEMT is set for all UARTs before this patch

> 2. World is not staying on OF only platforms

>

> NAK


Considering the use of the reversed capability UART_CAP_NOTEMT should I set
the flag directly in uart_config like:

[PORT_16550A_FSL64] = {
		.name		= "16550A_FSL64",
		.fifo_size	= 64,
		.tx_loadsz	= 63,
		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10 |
				  UART_FCR7_64BYTE,
		.flags		= UART_CAP_FIFO | UART_CAP_NOTEMT,
	},

>
Andy Shevchenko Jan. 29, 2021, 6:42 p.m. UTC | #2
On Fri, Jan 29, 2021 at 8:07 PM Eric Tremblay
<etremblay@distech-controls.com> wrote:
> On 2021-01-29 6:25 a.m., Andy Shevchenko wrote:


...

> Considering the use of the reversed capability UART_CAP_NOTEMT should I set

> the flag directly in uart_config like:

>

> [PORT_16550A_FSL64] = {

>                 .name           = "16550A_FSL64",

>                 .fifo_size      = 64,

>                 .tx_loadsz      = 63,

>                 .fcr            = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10 |

>                                   UART_FCR7_64BYTE,

>                 .flags          = UART_CAP_FIFO | UART_CAP_NOTEMT,

>         },


This looks much better!

-- 
With Best Regards,
Andy Shevchenko
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 4efc62c0b25c..9a5bb6837949 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -225,6 +225,9 @@  static int of_platform_serial_probe(struct platform_device *ofdev)
 			&port8250.overrun_backoff_time_ms) != 0)
 		port8250.overrun_backoff_time_ms = 0;
 
+	if (port_type != PORT_16550A_FSL64)
+		port8250.capabilities |= UART_CAP_TEMT;
+
 	ret = serial8250_register_8250_port(&port8250);
 	if (ret < 0)
 		goto err_dispose;