summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2016-04-21 18:58:31 +0900
committerSasha Levin <sasha.levin@oracle.com>2016-07-10 23:07:27 -0400
commit664fcc116904a7414f7bbd0831c973cbd28b59ad (patch)
tree8dd08e1486136feb14cc5ac7eb20648ccd934c2b
parent5ec75b71be17201805f2e6b7ef9f17f2d6b412d3 (diff)
downloadlinux-stable-664fcc116904a7414f7bbd0831c973cbd28b59ad.tar.gz
linux-stable-664fcc116904a7414f7bbd0831c973cbd28b59ad.tar.bz2
linux-stable-664fcc116904a7414f7bbd0831c973cbd28b59ad.zip
serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()
[ Upstream commit b8995f527aac143e83d3900ff39357651ea4e0f6 ] 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> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r--drivers/tty/serial/samsung.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 1e0d9b8c48c9..e42cb6bdd31d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1288,6 +1288,8 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
/* check to see if we need to change clock source */
if (ourport->baudclk != clk) {
+ clk_prepare_enable(clk);
+
s3c24xx_serial_setsource(port, clk_sel);
if (!IS_ERR(ourport->baudclk)) {
@@ -1295,8 +1297,6 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
ourport->baudclk = ERR_PTR(-EINVAL);
}
- clk_prepare_enable(clk);
-
ourport->baudclk = clk;
ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;
}