Skip to contentSkip to conversation

tty: serial: lpuart: disable flow control when wait transmit engine complete

PATCH In review Sherry Sun 2 participants 3 messages Aug 3, 2022 – Aug 4, 2022 TTY layer and serial drivers

lore
Share & tools
lore

Sherry Sun

author
#0 lore raw

PATCH 1/1 tty: serial: lpuart: disable flow control when wait transmit engine complete

When TX fifo has dirty data, user initialize the port and wait transmit engine complete, it should disable the flow control, otherwise tx fifo never be empty.

---
 drivers/tty/serial/fsl_lpuart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/fsl_lpuart.c +1 -0
index fc7d235a1e27..f0fccd2ff7ac 100644
@@ -2172,6 +2172,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
 	uart_update_timeout(port, termios->c_cflag, baud);
 
 	/* wait transmit engin complete */
+	lpuart32_write(&sport->port, 0, UARTMODIR);
 	lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
 
 	/* disable transmit and receive */
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 3 lines · Sherry Sun

When TX fifo has dirty data, user initialize the port and wait transmit engine complete, it should disable the flow control, otherwise tx fifo never be empty.

Sorry I cannot parse the above. Care to rephrase? (And maybe spellcheck?)

Quoted 10 lines
---
  drivers/tty/serial/fsl_lpuart.c | 1 +
  1 file changed, 1 insertion(+)
drivers/tty/serial/fsl_lpuart.c +0 -0
index fc7d235a1e27..f0fccd2ff7ac 100644

drivers/tty/serial/fsl_lpuart.c lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, · line 2178

Quoted 7 lines
drivers/tty/serial/fsl_lpuart.c +1 -0
@@ -2172,6 +2172,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
  	uart_update_timeout(port, termios->c_cflag, baud);
 
  	/* wait transmit engin complete */
+	lpuart32_write(&sport->port, 0, UARTMODIR);
  	lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
 
  	/* disable transmit and receive */

thanks,

Signature · 2 lines
js
suse labs
author
#2 lore raw
Quoted 7 lines · Sherry Sun
Quoted 3 lines

When TX fifo has dirty data, user initialize the port and wait transmit engine complete, it should disable the flow control, otherwise tx fifo never be empty.

Sorry I cannot parse the above. Care to rephrase? (And maybe spellcheck?)

Hi Jiri, sure, maybe some grammatical errors in the commit log, I can send V2 for your check. Thanks!

Best regards
Sherry

Quoted 25 lines

drivers/tty/serial/fsl_lpuart.c lpuart32_set_termios(struct uart_port *port,

Quoted 12 lines
---
  drivers/tty/serial/fsl_lpuart.c | 1 +
  1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/drivers/tty/serial/fsl_lpuart.c index fc7d235a1e27..f0fccd2ff7ac 100644

drivers/tty/serial/fsl_lpuart.c +0 -0
@@ -2172,6 +2172,7 @@ lpuart32_set_termios(struct uart_port *port,

struct ktermios *termios,

drivers/tty/serial/fsl_lpuart.c lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, · line 2178

Quoted 7 lines
drivers/tty/serial/fsl_lpuart.c +1 -0
  	uart_update_timeout(port, termios->c_cflag, baud);
 
  	/* wait transmit engin complete */
+	lpuart32_write(&sport->port, 0, UARTMODIR);
  	lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
 
  	/* disable transmit and receive */

thanks,
--
js
suse labs