]> git.baikalelectronics.ru Git - kernel.git/commit
serial: omap: fix rs485 half-duplex filtering
authorDario Binacchi <dariobin@libero.it>
Sun, 18 Apr 2021 09:47:05 +0000 (11:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Apr 2021 10:07:07 +0000 (12:07 +0200)
commit98a4cd0b9a1a3dbdc5ce906eceb4f2202caa3b79
tree464cf7ecf4c8e500712d01464f556e51feeb9920
parentbd54fbbb01a8f658bc0b7f862adf3158a23eab16
serial: omap: fix rs485 half-duplex filtering

Data received during half-duplex transmission must be filtered.
If the target device responds quickly, emptying the FIFO at the end of
the transmission can erase not only the echo characters but also part of
the response message.
By keeping the receive interrupt enabled even during transmission, it
allows you to filter each echo character and only in a number equal to
those transmitted.
The issue was generated by a target device that started responding
240us later having received a request in communication at 115200bps.
Sometimes, some messages received by the target were missing some of the
first bytes.

Fixes: 2f5834e66b8f ("tty/serial: omap: empty the RX FIFO at the end of half-duplex TX")
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Link: https://lore.kernel.org/r/20210418094705.27014-1-dariobin@libero.it
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/omap-serial.c