linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "serial: fsl_lpuart: Reset prior to registration"
@ 2022-09-29  8:53 Sherry Sun
  2022-09-29 10:51 ` Ilpo Järvinen
  2022-12-06 14:51 ` Francesco Dolcini
  0 siblings, 2 replies; 11+ messages in thread
From: Sherry Sun @ 2022-09-29  8:53 UTC (permalink / raw)
  To: gregkh, jirislaby, lukas; +Cc: linux-serial, linux-kernel, linux-imx

This reverts commit 60f361722ad2ae5ee667d0b0545d40c42f754daf.

commit 60f361722ad2 ("serial: fsl_lpuart: Reset prior to registration")
causes the lpuart console cannot work any more. Since the console is
registered in the uart_add_one_port(), the driver cannot identify the
console port before call uart_add_one_port(), which causes all the uart
ports including the console port will be global reset.
So need to revert this patch to avoid breaking the lpuart console.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
---
 drivers/tty/serial/fsl_lpuart.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 67fa113f77d4..7da46557fcb3 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2722,10 +2722,6 @@ static int lpuart_probe(struct platform_device *pdev)
 		handler = lpuart_int;
 	}
 
-	ret = lpuart_global_reset(sport);
-	if (ret)
-		goto failed_reset;
-
 	ret = uart_get_rs485_mode(&sport->port);
 	if (ret)
 		goto failed_get_rs485;
@@ -2734,6 +2730,10 @@ static int lpuart_probe(struct platform_device *pdev)
 	if (ret)
 		goto failed_attach_port;
 
+	ret = lpuart_global_reset(sport);
+	if (ret)
+		goto failed_reset;
+
 	ret = devm_request_irq(&pdev->dev, sport->port.irq, handler, 0,
 				DRIVER_NAME, sport);
 	if (ret)
@@ -2742,10 +2742,10 @@ static int lpuart_probe(struct platform_device *pdev)
 	return 0;
 
 failed_irq_request:
+failed_reset:
 	uart_remove_one_port(&lpuart_reg, &sport->port);
 failed_attach_port:
 failed_get_rs485:
-failed_reset:
 	lpuart_disable_clks(sport);
 	return ret;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-12-06 15:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  8:53 [PATCH] Revert "serial: fsl_lpuart: Reset prior to registration" Sherry Sun
2022-09-29 10:51 ` Ilpo Järvinen
2022-09-29 11:10   ` Sherry Sun
2022-09-29 11:19     ` Ilpo Järvinen
2022-09-30  8:02       ` Sherry Sun
2022-09-30 12:59         ` Ilpo Järvinen
2022-10-09 10:23           ` Sherry Sun
2022-10-10  9:09             ` Lukas Wunner
2022-10-11  8:07               ` Sherry Sun
2022-12-06 14:51 ` Francesco Dolcini
2022-12-06 15:08   ` Francesco Dolcini

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).