]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
efd23f1bb26e6ada563ed5c1088e1fa09a5220d0
[thirdparty/kernel/stable-queue.git] /
1 From b8995f527aac143e83d3900ff39357651ea4e0f6 Mon Sep 17 00:00:00 2001
2 From: Chanwoo Choi <cw00.choi@samsung.com>
3 Date: Thu, 21 Apr 2016 18:58:31 +0900
4 Subject: serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()
5
6 From: Chanwoo Choi <cw00.choi@samsung.com>
7
8 commit b8995f527aac143e83d3900ff39357651ea4e0f6 upstream.
9
10 This patch fixes the broken serial log when changing the clock source
11 of uart device. Before disabling the original clock source, this patch
12 enables the new clock source to protect the clock off state for a split second.
13
14 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
15 Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
18 Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
19
20 ---
21 drivers/tty/serial/samsung.c | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-)
23
24 --- a/drivers/tty/serial/samsung.c
25 +++ b/drivers/tty/serial/samsung.c
26 @@ -734,6 +734,8 @@ static void s3c24xx_serial_set_termios(s
27 /* check to see if we need to change clock source */
28
29 if (ourport->baudclk != clk) {
30 + clk_prepare_enable(clk);
31 +
32 s3c24xx_serial_setsource(port, clk_sel);
33
34 if (!IS_ERR(ourport->baudclk)) {
35 @@ -741,8 +743,6 @@ static void s3c24xx_serial_set_termios(s
36 ourport->baudclk = ERR_PTR(-EINVAL);
37 }
38
39 - clk_prepare_enable(clk);
40 -
41 ourport->baudclk = clk;
42 ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;
43 }