Commit 639949a
tty: serial: imx: fix rs485 rx after tx
Since commit 79d0224 ("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: 79d0224 ("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>1 parent e8cc334 commit 639949a
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
372 | 382 | | |
373 | 383 | | |
374 | 384 | | |
| |||
390 | 400 | | |
391 | 401 | | |
392 | 402 | | |
| 403 | + | |
393 | 404 | | |
394 | 405 | | |
395 | 406 | | |
| |||
1422 | 1433 | | |
1423 | 1434 | | |
1424 | 1435 | | |
1425 | | - | |
| 1436 | + | |
1426 | 1437 | | |
1427 | 1438 | | |
1428 | 1439 | | |
| |||
1521 | 1532 | | |
1522 | 1533 | | |
1523 | 1534 | | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
| 1535 | + | |
1528 | 1536 | | |
1529 | 1537 | | |
1530 | 1538 | | |
| |||
0 commit comments