[PATCH v2 2/2] tty: serial: 8250_mtk: manage baud clock in runtime PM ops

Daniel Golle daniel at makrotopia.org
Mon Sep 15 06:06:53 PDT 2025


The baud clock is gated on some MediaTek SoCs and can be managed by
runtime power management.

Disable and unprepare the baud clock when suspending the UART, prepare
and enable it again when resuming it.

Fixes: e32a83c70cf9 ("serial: 8250-mtk: modify mtk uart power and clock management")
Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
v2: add this patch as suggested by AngeloGioacchino Del Regno in
https://lore.kernel.org/all/8b1c1796-6de2-4526-9a29-d8649141b878@collabora.com/

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

diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index 9329ed1f759d..5875a7b9b4b1 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -435,6 +435,7 @@ static int __maybe_unused mtk8250_runtime_suspend(struct device *dev)
 	while
 		(serial_in(up, MTK_UART_DEBUG0));
 
+	clk_disable_unprepare(data->uart_clk);
 	clk_disable_unprepare(data->bus_clk);
 
 	return 0;
@@ -445,6 +446,7 @@ static int __maybe_unused mtk8250_runtime_resume(struct device *dev)
 	struct mtk8250_data *data = dev_get_drvdata(dev);
 
 	clk_prepare_enable(data->bus_clk);
+	clk_prepare_enable(data->uart_clk);
 
 	return 0;
 }
-- 
2.51.0



More information about the Linux-mediatek mailing list