mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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: <[email protected]> # v2.6.26+ Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
ddcbad9295
commit
1ff383a4c3
1 changed files with 4 additions and 0 deletions
|
|
@ -559,11 +559,15 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,
|
|||
unsigned int old)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
int timeout = 10000;
|
||||
|
||||
ourport->pm_level = level;
|
||||
|
||||
switch (level) {
|
||||
case 3:
|
||||
while (--timeout && !s3c24xx_serial_txempty_nofifo(port))
|
||||
udelay(100);
|
||||
|
||||
if (!IS_ERR(ourport->baudclk))
|
||||
clk_disable_unprepare(ourport->baudclk);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue