]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: stm32: do not always set SER_RS485_RX_DURING_TX if RS485 is enabled
authorLino Sanfilippo <l.sanfilippo@kunbus.com>
Fri, 16 Feb 2024 22:47:07 +0000 (23:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:35:02 +0000 (13:35 +0100)
commit3e3578ca1b877a49a7521e600d51658d6d794267
tree610660fab3391871d81d25457f3878fbfd1f1101
parent6cf046b3acea853a719c1e8a106144c89323b166
serial: stm32: do not always set SER_RS485_RX_DURING_TX if RS485 is enabled

commit f418ae73311deb901c0110b08d1bbafc20c1820e upstream.

Before commit 07c30ea5861f ("serial: Do not hold the port lock when setting
rx-during-tx GPIO") the SER_RS485_RX_DURING_TX flag was only set if the
rx-during-tx mode was not controlled by a GPIO. Now the flag is set
unconditionally when RS485 is enabled. This results in an incorrect setting
if the rx-during-tx GPIO is not asserted.

Fix this by setting the flag only if the rx-during-tx mode is not
controlled by a GPIO and thus restore the correct behaviour.

Cc: stable@vger.kernel.org # 6.6+
Fixes: 07c30ea5861f ("serial: Do not hold the port lock when setting rx-during-tx GPIO")
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20240216224709.9928-1-l.sanfilippo@kunbus.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/stm32-usart.c