提交 e1c609ef 编写于 作者: H Haavard Skinnemoen

atmel_serial: Drain console TX shifter before suspending

Funny things may happen if we stop the USART clock before the shifter is
empty. Prevent this from happening by waiting until the shifter is
completely drained before allowing suspend to continue.
Signed-off-by: NHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Andrew Victor <linux@maxim.org.za>
上级 f826caa4
......@@ -1454,6 +1454,12 @@ static int atmel_serial_suspend(struct platform_device *pdev,
struct uart_port *port = platform_get_drvdata(pdev);
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
if (atmel_is_console_port(port) && console_suspend_enabled) {
/* Drain the TX shifter */
while (!(UART_GET_CSR(port) & ATMEL_US_TXEMPTY))
cpu_relax();
}
if (device_may_wakeup(&pdev->dev)
&& !atmel_serial_clk_will_stop())
enable_irq_wake(port->irq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册