mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
tty/serial: omap: fix RX interrupt enable/disable in half-duplex TX
Make sure that serial_omap_stop_rx() also disables RDI (Receiver Data Interrupt), otherwise the interrupt handler will call serial_omap_rdi() to read the new data, resulting in the transmission being echoed back. When the half-duplex transmission is complete, in order to reverse the effects of serial_omap_stop_rx(), we should re-enable: * the RX interrupts _without_ overwriting up->ier * the UART_LSR_DR bit of the up->port.read_status_mask Signed-off-by: Dimitris Lampridis <dlampridis@logikonlabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9b971cd206
commit
cab53dc9e2
1 changed files with 3 additions and 2 deletions
|
@ -342,7 +342,8 @@ static void serial_omap_stop_tx(struct uart_port *port)
|
||||||
|
|
||||||
if ((up->rs485.flags & SER_RS485_ENABLED) &&
|
if ((up->rs485.flags & SER_RS485_ENABLED) &&
|
||||||
!(up->rs485.flags & SER_RS485_RX_DURING_TX)) {
|
!(up->rs485.flags & SER_RS485_RX_DURING_TX)) {
|
||||||
up->ier = UART_IER_RLSI | UART_IER_RDI;
|
up->ier |= UART_IER_RLSI | UART_IER_RDI;
|
||||||
|
up->port.read_status_mask |= UART_LSR_DR;
|
||||||
serial_out(up, UART_IER, up->ier);
|
serial_out(up, UART_IER, up->ier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,7 +356,7 @@ static void serial_omap_stop_rx(struct uart_port *port)
|
||||||
struct uart_omap_port *up = to_uart_omap_port(port);
|
struct uart_omap_port *up = to_uart_omap_port(port);
|
||||||
|
|
||||||
pm_runtime_get_sync(up->dev);
|
pm_runtime_get_sync(up->dev);
|
||||||
up->ier &= ~UART_IER_RLSI;
|
up->ier &= ~(UART_IER_RLSI | UART_IER_RDI);
|
||||||
up->port.read_status_mask &= ~UART_LSR_DR;
|
up->port.read_status_mask &= ~UART_LSR_DR;
|
||||||
serial_out(up, UART_IER, up->ier);
|
serial_out(up, UART_IER, up->ier);
|
||||||
pm_runtime_mark_last_busy(up->dev);
|
pm_runtime_mark_last_busy(up->dev);
|
||||||
|
|
Loading…
Reference in a new issue