Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248688
b: refs/heads/master
c: 5f873ba
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Warren authored and Greg Kroah-Hartman committed May 19, 2011
1 parent 5c9334c commit 56e136b
Show file tree
Hide file tree
Showing 3 changed files with 30 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: 4539c24fe4f92c09ee668ef959d3e8180df619b9
refs/heads/master: 5f873bae704cf8b7cbd64b5720912266286c9146
28 changes: 28 additions & 0 deletions trunk/drivers/tty/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,27 @@ static void serial8250_enable_ms(struct uart_port *port)
serial_out(up, UART_IER, up->ier);
}

/*
* Clear the Tegra rx fifo after a break
*
* FIXME: This needs to become a port specific callback once we have a
* framework for this
*/
static void clear_rx_fifo(struct uart_8250_port *up)
{
unsigned int status, tmout = 10000;
do {
status = serial_in(up, UART_LSR);
if (status & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS))
status = serial_in(up, UART_RX);
else
break;
if (--tmout == 0)
break;
udelay(1);
} while (1);
}

static void
receive_chars(struct uart_8250_port *up, unsigned int *status)
{
Expand Down Expand Up @@ -1467,6 +1488,13 @@ receive_chars(struct uart_8250_port *up, unsigned int *status)
if (lsr & UART_LSR_BI) {
lsr &= ~(UART_LSR_FE | UART_LSR_PE);
up->port.icount.brk++;
/*
* If tegra port then clear the rx fifo to
* accept another break/character.
*/
if (up->port.type == PORT_TEGRA)
clear_rx_fifo(up);

/*
* We do the SysRQ and SAK checking
* here because otherwise the break
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/serial_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
#define UART_MCR_DTR 0x01 /* DTR complement */

#define UART_LSR 5 /* In: Line Status Register */
#define UART_LSR_FIFOE 0x80 /* Fifo error */
#define UART_LSR_TEMT 0x40 /* Transmitter empty */
#define UART_LSR_THRE 0x20 /* Transmit-hold-register empty */
#define UART_LSR_BI 0x10 /* Break interrupt indicator */
Expand Down

0 comments on commit 56e136b

Please sign in to comment.