Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chanwoo Choi and committed by
Greg Kroah-Hartman
b8995f52 f5b556c9

+2 -2
+2 -2
drivers/tty/serial/samsung.c
··· 1271 1271 /* check to see if we need to change clock source */ 1272 1272 1273 1273 if (ourport->baudclk != clk) { 1274 + clk_prepare_enable(clk); 1275 + 1274 1276 s3c24xx_serial_setsource(port, clk_sel); 1275 1277 1276 1278 if (!IS_ERR(ourport->baudclk)) { 1277 1279 clk_disable_unprepare(ourport->baudclk); 1278 1280 ourport->baudclk = ERR_PTR(-EINVAL); 1279 1281 } 1280 - 1281 - clk_prepare_enable(clk); 1282 1282 1283 1283 ourport->baudclk = clk; 1284 1284 ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;