[PATCH 2/2] serial: pic32_uart: do not disable the clock in remove

From: Arina Kharlamova via B4 Relay

Date: Mon Nov 30 2026 - 17:57:36 EST


From: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>

The UART clock is enabled by pic32_uart_startup() and by the console
setup. The first is undone by pic32_uart_shutdown(), the second in
probe. pic32_uart_remove() nevertheless calls clk_disable_unprepare()
after uart_remove_one_port() has shut the port down, so every unbind
drops an enable this driver no longer holds.

On PIC32MZDA this clock is PB2CLK, which the clock driver enables once
as a critical clock and which all UARTs share. The first unbind can
gate it while other users still need it, and later unbinds make the
clock core warn.

Drop the call from pic32_uart_remove().

Fixes: 157b9394709e ("serial: pic32_uart: Add PIC32 UART driver")
Signed-off-by: Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>
---
drivers/tty/serial/pic32_uart.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
index 6c8874e50fa4..1dfee267c3ed 100644
--- a/drivers/tty/serial/pic32_uart.c
+++ b/drivers/tty/serial/pic32_uart.c
@@ -943,7 +943,6 @@ static void pic32_uart_remove(struct platform_device *pdev)
struct pic32_sport *sport = to_pic32_sport(port);

uart_remove_one_port(&pic32_uart_driver, port);
- clk_disable_unprepare(sport->clk);
platform_set_drvdata(pdev, NULL);
pic32_sports[sport->idx] = NULL;
}

--
Git-157)