提交 1ff383a4 编写于 作者: R Robert Baldyga 提交者: Greg Kroah-Hartman

serial: samsung: wait for transfer completion before clock disable

This patch adds waiting until transmit buffer and shifter will be empty
before clock disabling.

Without this fix it's possible to have clock disabled while data was
not transmited yet, which causes unproper state of TX line and problems
in following data transfers.

Cc: <stable@vger.kernel.org> # v2.6.26+
Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ddcbad92
...@@ -559,11 +559,15 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, ...@@ -559,11 +559,15 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
unsigned int old) unsigned int old)
{ {
struct s3c24xx_uart_port *ourport = to_ourport(port); struct s3c24xx_uart_port *ourport = to_ourport(port);
int timeout = 10000;
ourport->pm_level = level; ourport->pm_level = level;
switch (level) { switch (level) {
case 3: case 3:
while (--timeout && !s3c24xx_serial_txempty_nofifo(port))
udelay(100);
if (!IS_ERR(ourport->baudclk)) if (!IS_ERR(ourport->baudclk))
clk_disable_unprepare(ourport->baudclk); clk_disable_unprepare(ourport->baudclk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册