Commit df8ad62006f452ee4902e216e955f1a142cf144f

Authored by Chanwoo Choi
Committed by Greg Kroah-Hartman
1 parent 430b4aab73

serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()

commit b8995f527aac143e83d3900ff39357651ea4e0f6 upstream.

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>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/tty/serial/samsung.c
... ... @@ -1263,14 +1263,14 @@
1263 1263 /* check to see if we need to change clock source */
1264 1264  
1265 1265 if (ourport->baudclk != clk) {
  1266 + clk_prepare_enable(clk);
  1267 +
1266 1268 s3c24xx_serial_setsource(port, clk_sel);
1267 1269  
1268 1270 if (!IS_ERR(ourport->baudclk)) {
1269 1271 clk_disable_unprepare(ourport->baudclk);
1270 1272 ourport->baudclk = ERR_PTR(-EINVAL);
1271 1273 }
1272   -
1273   - clk_prepare_enable(clk);
1274 1274  
1275 1275 ourport->baudclk = clk;
1276 1276 ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0;