diff options
author | Martin Fuzzey | 2023-06-16 12:47:23 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-07-23 13:49:41 +0200 |
commit | 5553d587a371326644d5d59bb4ff88f9d6ac76ed (patch) | |
tree | 1854e31a10d360d6dd3a997969ca96e6cfa2e06c /drivers/spi/spi-sh-sci.c | |
parent | f0bf102ef9b05d7294bd8d506755465f6867d944 (diff) |
tty: serial: imx: fix rs485 rx after tx
commit 639949a7031e04c59ec91614eceb9543e9120f43 upstream.
Since commit 79d0224f6bf2 ("tty: serial: imx: Handle RS485 DE signal
active high") RS485 reception no longer works after a transmission.
The following scenario shows the problem:
1) Open a port in RS485 mode
2) Receive data from remote (OK)
3) Transmit data to remote (OK)
4) Receive data from remote (Nothing received)
In RS485 mode, imx_uart_start_tx() calls imx_uart_stop_rx() and, when the
transmission is complete, imx_uart_stop_tx() calls imx_uart_start_rx().
Since the above commit imx_uart_stop_rx() now sets the loopback bit but
imx_uart_start_rx() does not clear it causing the hardware to remain in
loopback mode and not receive external data.
Fix this by moving the existing loopback disable code to a helper function
and calling it from imx_uart_start_rx() too.
Fixes: 79d0224f6bf2 ("tty: serial: imx: Handle RS485 DE signal active high")
Cc: stable@vger.kernel.org
Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230616104838.2729694-1-martin.fuzzey@flowbird.group
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/spi/spi-sh-sci.c')
0 files changed, 0 insertions, 0 deletions