diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2015-11-18 09:41:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-13 22:59:48 -0500 |
commit | 88679739012cda64b1a45ee9dea16d04380dba71 (patch) | |
tree | ed2430c80a710895825ae71e52f1382b456a6b0c /drivers/tty | |
parent | 00661dd855b5b174aa176a9ab9437d86ef4f8f1a (diff) |
ARM: meson: serial: tx_empty fails to check for transmitter busy
The tx_empty() uart_op should only return empty if both the transmit fifo
and the transmit state-machine are both idle. Add a test for the hardware's
XMIT_BUSY flag.
Note, this is possibly related to an issue where the port is being shutdown
with paritally transmitted characters in it.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reported-by: Edward Cragg <edward.cragg@codethink.co.uk>
Tested-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/meson_uart.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index b87eb97e5e7a..54d1b9591b8d 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c | |||
@@ -57,6 +57,7 @@ | |||
57 | #define AML_UART_RX_EMPTY BIT(20) | 57 | #define AML_UART_RX_EMPTY BIT(20) |
58 | #define AML_UART_TX_FULL BIT(21) | 58 | #define AML_UART_TX_FULL BIT(21) |
59 | #define AML_UART_TX_EMPTY BIT(22) | 59 | #define AML_UART_TX_EMPTY BIT(22) |
60 | #define AML_UART_XMIT_BUSY BIT(25) | ||
60 | #define AML_UART_ERR (AML_UART_PARITY_ERR | \ | 61 | #define AML_UART_ERR (AML_UART_PARITY_ERR | \ |
61 | AML_UART_FRAME_ERR | \ | 62 | AML_UART_FRAME_ERR | \ |
62 | AML_UART_TX_FIFO_WERR) | 63 | AML_UART_TX_FIFO_WERR) |
@@ -100,7 +101,8 @@ static unsigned int meson_uart_tx_empty(struct uart_port *port) | |||
100 | u32 val; | 101 | u32 val; |
101 | 102 | ||
102 | val = readl(port->membase + AML_UART_STATUS); | 103 | val = readl(port->membase + AML_UART_STATUS); |
103 | return (val & AML_UART_TX_EMPTY) ? TIOCSER_TEMT : 0; | 104 | val &= (AML_UART_TX_EMPTY | AML_UART_XMIT_BUSY); |
105 | return (val == AML_UART_TX_EMPTY) ? TIOCSER_TEMT : 0; | ||
104 | } | 106 | } |
105 | 107 | ||
106 | static void meson_uart_stop_tx(struct uart_port *port) | 108 | static void meson_uart_stop_tx(struct uart_port *port) |