Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338455
b: refs/heads/master
c: 1cd3f2d
h: refs/heads/master
i:
  338453: e6fde97
  338451: c448f14
  338447: 3e7b483
v: v3
  • Loading branch information
Sonic Zhang authored and Greg Kroah-Hartman committed Nov 21, 2012
1 parent c8c2eb5 commit 3eb4a05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 159a8e92fdf6967cb67e7639832f819fbc607242
refs/heads/master: 1cd3f2d2c99892209c4751155ae56ff18b1b253e
9 changes: 9 additions & 0 deletions trunk/drivers/tty/serial/bfin_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
unsigned long flags;
unsigned int baud, quot;
unsigned int ier, lcr = 0;
unsigned long timeout;

switch (termios->c_cflag & CSIZE) {
case CS8:
Expand Down Expand Up @@ -868,6 +869,14 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,

UART_SET_ANOMALY_THRESHOLD(uart, USEC_PER_SEC / baud * 15);

/* Wait till the transfer buffer is empty */
timeout = jiffies + msecs_to_jiffies(10);
while (UART_GET_GCTL(uart) & UCEN && !(UART_GET_LSR(uart) & TEMT))
if (time_after(jiffies, timeout)) {
dev_warn(port->dev, "timeout waiting for TX buffer empty\n");
break;
}

/* Disable UART */
ier = UART_GET_IER(uart);
UART_PUT_GCTL(uart, UART_GET_GCTL(uart) & ~UCEN);
Expand Down

0 comments on commit 3eb4a05

Please sign in to comment.