From 2429e94ad394a41b5c2f431958d0df738a775069 Mon Sep 17 00:00:00 2001 From: Liang Li Date: Sat, 19 Jan 2013 17:52:11 +0800 Subject: [PATCH] --- yaml --- r: 354825 b: refs/heads/master c: 1f9db0921f212ad8fdf4bacfdf23590e64272f90 h: refs/heads/master i: 354823: e51b13505e7304a54899f1cc49e91156a3149b47 v: v3 --- [refs] | 2 +- trunk/drivers/tty/serial/pch_uart.c | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 836573b804b0..3457a86fdc2c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 384e301e3519599b000c1a2ecd938b533fc15d85 +refs/heads/master: 1f9db0921f212ad8fdf4bacfdf23590e64272f90 diff --git a/trunk/drivers/tty/serial/pch_uart.c b/trunk/drivers/tty/serial/pch_uart.c index 10e1a95b0c92..1ddfc66b1084 100644 --- a/trunk/drivers/tty/serial/pch_uart.c +++ b/trunk/drivers/tty/serial/pch_uart.c @@ -14,18 +14,21 @@ *along with this program; if not, write to the Free Software *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ +#if defined(CONFIG_SERIAL_PCH_UART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#define SUPPORT_SYSRQ +#endif #include #include #include #include #include +#include #include #include #include #include #include #include -#include #include #include @@ -553,12 +556,24 @@ static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf, { int i; u8 rbr, lsr; + struct uart_port *port = &priv->port; lsr = ioread8(priv->membase + UART_LSR); for (i = 0, lsr = ioread8(priv->membase + UART_LSR); - i < rx_size && lsr & UART_LSR_DR; + i < rx_size && lsr & (UART_LSR_DR | UART_LSR_BI); lsr = ioread8(priv->membase + UART_LSR)) { rbr = ioread8(priv->membase + PCH_UART_RBR); + + if (lsr & UART_LSR_BI) { + port->icount.brk++; + if (uart_handle_break(port)) + continue; + } + if (port->sysrq) { + if (uart_handle_sysrq_char(port, rbr)) + continue; + } + buf[i++] = rbr; } return i; @@ -1023,16 +1038,11 @@ static unsigned int dma_handle_tx(struct eg20t_port *priv) static void pch_uart_err_ir(struct eg20t_port *priv, unsigned int lsr) { - u8 fcr = ioread8(priv->membase + UART_FCR); struct uart_port *port = &priv->port; struct tty_struct *tty = tty_port_tty_get(&port->state->port); char *error_msg[5] = {}; int i = 0; - /* Reset FIFO */ - fcr |= UART_FCR_CLEAR_RCVR; - iowrite8(fcr, priv->membase + UART_FCR); - if (lsr & PCH_UART_LSR_ERR) error_msg[i++] = "Error data in FIFO\n"; @@ -1565,7 +1575,8 @@ pch_console_write(struct console *co, const char *s, unsigned int count) local_irq_save(flags); if (priv->port.sysrq) { - spin_lock(&priv->lock); + /* call to uart_handle_sysrq_char already took the priv lock */ + priv_locked = 0; /* serial8250_handle_port() already took the port lock */ port_locked = 0; } else if (oops_in_progress) {