* [PATCH 5.15.y] tty: serial: fsl_lpuart: fixup error path in lpuart_probe()
@ 2022-12-20 10:23 Rasmus Villemoes
2022-12-22 11:44 ` [PATCH 5.15.y v2] serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way" Rasmus Villemoes
0 siblings, 1 reply; 4+ messages in thread
From: Rasmus Villemoes @ 2022-12-20 10:23 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Ilpo Järvinen, Lukas Wunner,
Daisuke Mizobuchi, Dominique Martinet
Cc: stable, linux-serial, Rasmus Villemoes
When 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in
driver-specific way") got backported to 5.15.y, there known as
b079d3775237, this hunk was accidentally left out. So if the "goto
failed_get_rs485;" is hit, the cleanup will do uart_remove_one_port()
despite uart_add_one_port() not having been called.
Add the missing hunk.
Fixes: b079d3775237 ("serial: Deassert Transmit Enable on probe in driver-specific way")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
Not quite sure how to submit patches for a specific -stable series
only, or if the Fixes tag is appropriate and correct. Please let me
know if you'd have preferred anything different.
drivers/tty/serial/fsl_lpuart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 595430aedc0d..fc311df9f1c9 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2784,9 +2784,9 @@ static int lpuart_probe(struct platform_device *pdev)
return 0;
failed_irq_request:
-failed_get_rs485:
uart_remove_one_port(&lpuart_reg, &sport->port);
failed_attach_port:
+failed_get_rs485:
failed_reset:
lpuart_disable_clks(sport);
return ret;
base-commit: fd6d66840b4269da4e90e1ea807ae3197433bc66
--
2.37.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 5.15.y v2] serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
2022-12-20 10:23 [PATCH 5.15.y] tty: serial: fsl_lpuart: fixup error path in lpuart_probe() Rasmus Villemoes
@ 2022-12-22 11:44 ` Rasmus Villemoes
2022-12-23 2:12 ` Dominique Martinet
2023-01-12 12:41 ` Greg Kroah-Hartman
0 siblings, 2 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2022-12-22 11:44 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Lukas Wunner, Dominique Martinet,
Daisuke Mizobuchi, Ilpo Järvinen
Cc: linux-serial, stable, Rasmus Villemoes
When 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in
driver-specific way") got backported to 5.15.y, there known as
b079d3775237, some hunks were accidentally left out.
In fsl_lpuart.c, this amounts to uart_remove_one_port() being called
in an error path despite uart_add_one_port() not having been called.
In serial_core.c, it is possible that the omission in
uart_suspend_port() is harmless, but the backport did have the
corresponding hunk in uart_resume_port(), it runs counter to the
original commit's intention of
Skip any invocation of ->set_mctrl() if RS485 is enabled.
and it's certainly better to be aligned with upstream.
Fixes: b079d3775237 ("serial: Deassert Transmit Enable on probe in driver-specific way")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
v2: Also amend uart_suspend_port(), update commit log accordingly.
drivers/tty/serial/fsl_lpuart.c | 2 +-
drivers/tty/serial/serial_core.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 595430aedc0d..fc311df9f1c9 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2784,9 +2784,9 @@ static int lpuart_probe(struct platform_device *pdev)
return 0;
failed_irq_request:
-failed_get_rs485:
uart_remove_one_port(&lpuart_reg, &sport->port);
failed_attach_port:
+failed_get_rs485:
failed_reset:
lpuart_disable_clks(sport);
return ret;
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 5f8f0a90ce55..45b721abaa2f 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2225,7 +2225,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
spin_lock_irq(&uport->lock);
ops->stop_tx(uport);
- ops->set_mctrl(uport, 0);
+ if (!(uport->rs485.flags & SER_RS485_ENABLED))
+ ops->set_mctrl(uport, 0);
ops->stop_rx(uport);
spin_unlock_irq(&uport->lock);
base-commit: 5827ddaf4534c52d31dd464679a186b41810ef76
--
2.37.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 5.15.y v2] serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
2022-12-22 11:44 ` [PATCH 5.15.y v2] serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way" Rasmus Villemoes
@ 2022-12-23 2:12 ` Dominique Martinet
2023-01-12 12:41 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Dominique Martinet @ 2022-12-23 2:12 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Greg Kroah-Hartman, Jiri Slaby, Lukas Wunner, Daisuke Mizobuchi,
Ilpo Järvinen, linux-serial, stable
Rasmus Villemoes wrote on Thu, Dec 22, 2022 at 12:44:14PM +0100:
> When 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in
> driver-specific way") got backported to 5.15.y, there known as
> b079d3775237, some hunks were accidentally left out.
>
> In fsl_lpuart.c, this amounts to uart_remove_one_port() being called
> in an error path despite uart_add_one_port() not having been called.
>
> In serial_core.c, it is possible that the omission in
> uart_suspend_port() is harmless, but the backport did have the
> corresponding hunk in uart_resume_port(), it runs counter to the
> original commit's intention of
>
> Skip any invocation of ->set_mctrl() if RS485 is enabled.
>
> and it's certainly better to be aligned with upstream.
>
> Fixes: b079d3775237 ("serial: Deassert Transmit Enable on probe in driver-specific way")
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Thank you!
I've confirmed both hunks are part of the original patch; I'm not quite
sure why we missed them...
Reviewed-by: Dominique MARTINET <dominique.martinet@atmark-techno.com>
This doesn't apply cleanly to 5.10 because 5.10 did not get
401fb66a3 ("fsl_lpuart: Don't enable interrupts too early") backported,
I think it makes sense to take as well so I'll send a backport of these
two patches for 5.10
--
Dominique
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 5.15.y v2] serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
2022-12-22 11:44 ` [PATCH 5.15.y v2] serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way" Rasmus Villemoes
2022-12-23 2:12 ` Dominique Martinet
@ 2023-01-12 12:41 ` Greg Kroah-Hartman
1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2023-01-12 12:41 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Jiri Slaby, Lukas Wunner, Dominique Martinet, Daisuke Mizobuchi,
Ilpo Järvinen, linux-serial, stable
On Thu, Dec 22, 2022 at 12:44:14PM +0100, Rasmus Villemoes wrote:
> When 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in
> driver-specific way") got backported to 5.15.y, there known as
> b079d3775237, some hunks were accidentally left out.
>
> In fsl_lpuart.c, this amounts to uart_remove_one_port() being called
> in an error path despite uart_add_one_port() not having been called.
>
> In serial_core.c, it is possible that the omission in
> uart_suspend_port() is harmless, but the backport did have the
> corresponding hunk in uart_resume_port(), it runs counter to the
> original commit's intention of
>
> Skip any invocation of ->set_mctrl() if RS485 is enabled.
>
> and it's certainly better to be aligned with upstream.
>
> Fixes: b079d3775237 ("serial: Deassert Transmit Enable on probe in driver-specific way")
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>
> v2: Also amend uart_suspend_port(), update commit log accordingly.
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-12 12:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-20 10:23 [PATCH 5.15.y] tty: serial: fsl_lpuart: fixup error path in lpuart_probe() Rasmus Villemoes
2022-12-22 11:44 ` [PATCH 5.15.y v2] serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way" Rasmus Villemoes
2022-12-23 2:12 ` Dominique Martinet
2023-01-12 12:41 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).