Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "serial: sc16is7xx: Clear RS485 bits in the shutdown"

This reverts commit 927728a34f11b5a27f4610bdb7068317d6fdc72a.

Once the uart_port->rs485->flag is set to SER_RS485_ENABLED, the port
should always work in RS485 mode. If users want the port to leave
RS485 mode, they need to call ioctl() to clear SER_RS485_ENABLED.

So here we shouldn't clear the RS485 bits in the shutdown().

Fixes: 927728a34f11 ("serial: sc16is7xx: Clear RS485 bits in the shutdown")
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20220418094339.678144-1-hui.wang@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hui Wang and committed by
Greg Kroah-Hartman
41c60687 48473802

+2 -4
+2 -4
drivers/tty/serial/sc16is7xx.c
··· 1238 1238 1239 1239 /* Disable all interrupts */ 1240 1240 sc16is7xx_port_write(port, SC16IS7XX_IER_REG, 0); 1241 - /* Disable TX/RX, clear auto RS485 and RTS invert */ 1241 + /* Disable TX/RX */ 1242 1242 sc16is7xx_port_update(port, SC16IS7XX_EFCR_REG, 1243 1243 SC16IS7XX_EFCR_RXDISABLE_BIT | 1244 - SC16IS7XX_EFCR_TXDISABLE_BIT | 1245 - SC16IS7XX_EFCR_AUTO_RS485_BIT | 1246 - SC16IS7XX_EFCR_RTS_INVERT_BIT, 1244 + SC16IS7XX_EFCR_TXDISABLE_BIT, 1247 1245 SC16IS7XX_EFCR_RXDISABLE_BIT | 1248 1246 SC16IS7XX_EFCR_TXDISABLE_BIT); 1249 1247