Skip to content

Commit b8995f5

Browse files
chanwoochoigregkh
authored andcommitted
serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()
This patch fixes the broken serial log when changing the clock source of uart device. Before disabling the original clock source, this patch enables the new clock source to protect the clock off state for a split second. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f5b556c commit b8995f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/samsung.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,15 +1271,15 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
12711271
/* check to see if we need to change clock source */
12721272

12731273
if (ourport->baudclk != clk) {
1274+
clk_prepare_enable(clk);
1275+
12741276
s3c24xx_serial_setsource(port, clk_sel);
12751277

12761278
if (!IS_ERR(ourport->baudclk)) {
12771279
clk_disable_unprepare(ourport->baudclk);
12781280
ourport->baudclk = ERR_PTR(-EINVAL);
12791281
}
12801282

1281-
clk_prepare_enable(clk);
1282-
12831283
ourport->baudclk = clk;
12841284
ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;
12851285
}

0 commit comments

Comments
 (0)