]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
5b4a3e77bccf66e4fa7cf238f215f75de230059f
[thirdparty/kernel/stable-queue.git] /
1 From dominique.martinet@atmark-techno.com Thu Jan 12 13:46:08 2023
2 From: Dominique Martinet <dominique.martinet@atmark-techno.com>
3 Date: Fri, 23 Dec 2022 13:23:54 +0900
4 Subject: serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
5 To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Jiri Slaby" <jirislaby@kernel.org>, "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>, "Lukas Wunner" <lukas@wunner.de>, "Rasmus Villemoes" <linux@rasmusvillemoes.dk>
6 Cc: Daisuke Mizobuchi <mizo@atmark-techno.com>, stable@vger.kernel.org, linux-serial@vger.kernel.org, Dominique Martinet <dominique.martinet@atmark-techno.com>
7 Message-ID: <20221223042354.4080724-2-dominique.martinet@atmark-techno.com>
8
9 From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
10
11 When 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in
12 driver-specific way") got backported to 5.10.y, there known as
13 26a2b9c468de, some hunks were accidentally left out.
14
15 In serial_core.c, it is possible that the omission in
16 uart_suspend_port() is harmless, but the backport did have the
17 corresponding hunk in uart_resume_port(), it runs counter to the
18 original commit's intention of
19
20 Skip any invocation of ->set_mctrl() if RS485 is enabled.
21
22 and it's certainly better to be aligned with upstream.
23
24 Link: https://lkml.kernel.org/r/20221222114414.1886632-1-linux@rasmusvillemoes.dk
25 Fixes: 26a2b9c468de ("serial: Deassert Transmit Enable on probe in driver-specific way")
26 Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
27 [the fsl_lpuart part of the 5.15 patch is not required on 5.10,
28 because the code before 26a2b9c468de was incorrectly not calling
29 uart_remove_one_port on failed_get_rs485]
30 Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32 ---
33 drivers/tty/serial/serial_core.c | 3 ++-
34 1 file changed, 2 insertions(+), 1 deletion(-)
35
36 --- a/drivers/tty/serial/serial_core.c
37 +++ b/drivers/tty/serial/serial_core.c
38 @@ -2254,7 +2254,8 @@ int uart_suspend_port(struct uart_driver
39
40 spin_lock_irq(&uport->lock);
41 ops->stop_tx(uport);
42 - ops->set_mctrl(uport, 0);
43 + if (!(uport->rs485.flags & SER_RS485_ENABLED))
44 + ops->set_mctrl(uport, 0);
45 ops->stop_rx(uport);
46 spin_unlock_irq(&uport->lock);
47