Skip to content

Commit

Permalink
serial: samsung: Reorder the sequence of clock control when call s3c2…
Browse files Browse the repository at this point in the history
…4xx_serial_set_termios()

[ Upstream commit b8995f5 ]

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>
  • Loading branch information
Chanwoo Choi authored and Sasha Levin committed Jul 11, 2016
1 parent 5ec75b7 commit 664fcc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,15 +1288,15 @@ 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)) {
clk_disable_unprepare(ourport->baudclk);
ourport->baudclk = ERR_PTR(-EINVAL);
}

clk_prepare_enable(clk);

ourport->baudclk = clk;
ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;
}
Expand Down

0 comments on commit 664fcc1

Please sign in to comment.