diff options
author | Yegor Yefremov <yegorslists@googlemail.com> | 2016-03-24 04:03:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-19 02:15:38 -0400 |
commit | 0c66940d584d1aac92f6a78460dc0ba2efd3b7ba (patch) | |
tree | b4bc9eaa1ee95b14d7739cad19c682acc37698e2 | |
parent | 9220ebffda4aa23fe683c9ca6c94fb72d7c131c2 (diff) |
tty/serial/8250: fix RS485 half-duplex RX
When in half-duplex mode RX will be disabled before TX, but not
enabled after deactivating transmitter. This patch enables
UART_IER_RLSI and UART_IER_RDI interrupts after TX is over.
Cc: Matwey V. Kornilov <matwey@sai.msu.ru>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")
Acked-by: Matwey V. Kornilov <matwey@sai.msu.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/8250/8250_port.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index e213da01a3d7..00ad2637b08c 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c | |||
@@ -1403,9 +1403,18 @@ static void __do_stop_tx_rs485(struct uart_8250_port *p) | |||
1403 | /* | 1403 | /* |
1404 | * Empty the RX FIFO, we are not interested in anything | 1404 | * Empty the RX FIFO, we are not interested in anything |
1405 | * received during the half-duplex transmission. | 1405 | * received during the half-duplex transmission. |
1406 | * Enable previously disabled RX interrupts. | ||
1406 | */ | 1407 | */ |
1407 | if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) | 1408 | if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) { |
1408 | serial8250_clear_fifos(p); | 1409 | serial8250_clear_fifos(p); |
1410 | |||
1411 | serial8250_rpm_get(p); | ||
1412 | |||
1413 | p->ier |= UART_IER_RLSI | UART_IER_RDI; | ||
1414 | serial_port_out(&p->port, UART_IER, p->ier); | ||
1415 | |||
1416 | serial8250_rpm_put(p); | ||
1417 | } | ||
1409 | } | 1418 | } |
1410 | 1419 | ||
1411 | static void serial8250_em485_handle_stop_tx(unsigned long arg) | 1420 | static void serial8250_em485_handle_stop_tx(unsigned long arg) |