Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 1/2] tty: serial: 8250_mtk: enable baud clock
@ 2025-09-15 13:06 Daniel Golle
  2025-09-15 13:06 ` [PATCH v2 2/2] tty: serial: 8250_mtk: manage baud clock in runtime PM ops Daniel Golle
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Daniel Golle @ 2025-09-15 13:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Matthias Brugger,
	AngeloGioacchino Del Regno, Daniel Golle, Uwe Kleine-König,
	Yu Jiaoliang, Andy Shevchenko, Changqi Hu, Sam Shih, Steven Liu,
	John Crispin, linux-kernel, linux-serial, linux-arm-kernel,
	linux-mediatek

Some MediaTek SoCs got a gated UART baud clock, which currently gets
disabled as the clk subsystem believes it would be unused. This results in
the uart freezing right after "clk: Disabling unused clocks" on those
platforms.

To fix this request the baud clock to be prepared and enabled during probe.

Fixes: e32a83c70cf9 ("serial: 8250-mtk: modify mtk uart power and clock management")
Suggested-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
v2: no changes

 drivers/tty/serial/8250/8250_mtk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index b44de2ed7413..9329ed1f759d 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -475,13 +475,13 @@ static int mtk8250_probe_of(struct platform_device *pdev, struct uart_port *p,
 	int dmacnt;
 #endif
 
-	data->uart_clk = devm_clk_get(&pdev->dev, "baud");
+	data->uart_clk = devm_clk_get_enabled(&pdev->dev, "baud");
 	if (IS_ERR(data->uart_clk)) {
 		/*
 		 * For compatibility with older device trees try unnamed
 		 * clk when no baud clk can be found.
 		 */
-		data->uart_clk = devm_clk_get(&pdev->dev, NULL);
+		data->uart_clk = devm_clk_get_enabled(&pdev->dev, NULL);
 		if (IS_ERR(data->uart_clk)) {
 			dev_warn(&pdev->dev, "Can't get uart clock\n");
 			return PTR_ERR(data->uart_clk);
-- 
2.51.0

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

end of thread, other threads:[~2025-09-15 14:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-15 13:06 [PATCH v2 1/2] tty: serial: 8250_mtk: enable baud clock Daniel Golle
2025-09-15 13:06 ` [PATCH v2 2/2] tty: serial: 8250_mtk: manage baud clock in runtime PM ops Daniel Golle
2025-09-15 13:41 ` [PATCH v2 1/2] tty: serial: 8250_mtk: enable baud clock AngeloGioacchino Del Regno
2025-09-15 14:51   ` Andy Shevchenko
2025-09-15 14:54 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox